Commit 4ef1f87e authored by devjiwonchoi's avatar devjiwonchoi

move away the style from svg

parent f79a6877
......@@ -29,7 +29,15 @@ export function RestartServerButton({ showButton }: { showButton: boolean }) {
disabled={isPending}
title="Clears the bundler cache and restarts the dev server. Helpful if you are seeing stale errors or changes are not appearing."
>
<RefreshClockWise width={14} height={14} spinning={isPending} />
<RefreshClockWise
width={14}
height={14}
style={{
animation: isPending
? 'refresh-clock-wise-spin 1s linear infinite'
: undefined,
}}
/>
{isPending ? 'Restarting...' : 'Reset Bundler Cache'}
</button>
)
......@@ -106,4 +114,13 @@ export const RESTART_SERVER_BUTTON_STYLES = css`
opacity: 0.6;
cursor: not-allowed;
}
@keyframes refresh-clock-wise-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
`
import { css } from '../utils/css'
export function RefreshClockWise({
spinning,
...props
}: React.SVGProps<SVGSVGElement> & { spinning: boolean }) {
export function RefreshClockWise(props: React.SVGProps<SVGSVGElement>) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
fill="currentColor"
{...props}
style={{
animation: spinning
? 'refresh-clock-wise-spin 1s linear infinite'
: undefined,
...props.style,
}}
>
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" {...props}>
<path
d="M4.30969 8.37891H2.38782C2.9805 10.3647 4.82188 11.8124 7.00012 11.8125C8.81977 11.8124 10.4043 10.8024 11.2228 9.30957L11.5382 8.73438L12.6896 9.36523L12.3741 9.94043L12.1681 10.2891C11.0815 11.993 9.17324 13.1249 7.00012 13.125C4.42207 13.1249 2.21747 11.5322 1.3136 9.27734V11.375H0.00109863V7.72266L0.0147705 7.58984C0.0760304 7.29089 0.340278 7.06641 0.657349 7.06641H4.30969V8.37891ZM7.00012 0.875C9.57685 0.875118 11.7819 2.46569 12.6866 4.71875V2.625H13.9991V6.27734C13.9991 6.63974 13.7053 6.93354 13.3429 6.93359H9.68958V5.62109H11.6115C11.0186 3.6356 9.17813 2.18763 7.00012 2.1875C5.17131 2.18757 3.57959 3.20771 2.76477 4.71289L2.45227 5.29004L1.29797 4.66504L1.61047 4.08789C2.64547 2.17605 4.67052 0.875068 7.00012 0.875Z"
fill="#A35200"
......@@ -23,14 +8,3 @@ export function RefreshClockWise({
</svg>
)
}
export const REFRESH_CLOCK_WISE_STYLES = css`
@keyframes refresh-clock-wise-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
`
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment