summaryrefslogtreecommitdiff
path: root/src/components/shared
diff options
context:
space:
mode:
authorMatain <[email protected]>2022-06-12 23:57:53 +0800
committerMatain <[email protected]>2022-06-12 23:57:53 +0800
commita0fedebe3e03bda70b59881b0c49b87af6771a33 (patch)
tree4d7d087aa46a2b1cf39717e14ed4f805300897c2 /src/components/shared
parent065069e5528f01c87e22b613913fb8e0df3b8d4a (diff)
Revert "Merge branch 'haishanh-master'"
This reverts commit e4e921e0b93f74bf126ca80cbb83f5e912f73a88, reversing changes made to a825925cc97d95762634d234ef06be1627a21fb1.
Diffstat (limited to 'src/components/shared')
-rw-r--r--src/components/shared/Fab.tsx12
-rw-r--r--src/components/shared/RotateIcon.tsx9
-rw-r--r--src/components/shared/TextFitler.tsx5
-rw-r--r--src/components/shared/ThemeSwitcher.module.scss3
-rw-r--r--src/components/shared/ZapAnimated.module.scss12
-rw-r--r--src/components/shared/ZapAnimated.tsx25
6 files changed, 19 insertions, 47 deletions
diff --git a/src/components/shared/Fab.tsx b/src/components/shared/Fab.tsx
index 8e72432..832306e 100644
--- a/src/components/shared/Fab.tsx
+++ b/src/components/shared/Fab.tsx
@@ -28,7 +28,8 @@ const AB: React.FC<ABProps> = ({ children, ...p }) => (
</button>
);
-interface MBProps extends Omit<React.HTMLAttributes<HTMLButtonElement>, 'tabIndex'> {
+interface MBProps
+ extends Omit<React.HTMLAttributes<HTMLButtonElement>, 'tabIndex'> {
tabIndex?: number;
}
@@ -76,7 +77,10 @@ const Fab: React.FC<FabProps> = ({
return event === 'click' ? (isOpen ? close() : open()) : null;
};
- const actionOnClick = (e: React.FormEvent, userFunc: (e: React.FormEvent) => void) => {
+ const actionOnClick = (
+ e: React.FormEvent,
+ userFunc: (e: React.FormEvent) => void
+ ) => {
e.persist();
setIsOpen(false);
setTimeout(() => {
@@ -137,7 +141,9 @@ const Fab: React.FC<FabProps> = ({
</MB>
{text && (
<span
- className={`${'right' in style ? 'right' : ''} ${alwaysShowTitle ? 'always-show' : ''}`}
+ className={`${'right' in style ? 'right' : ''} ${
+ alwaysShowTitle ? 'always-show' : ''
+ }`}
aria-hidden={ariaHidden}
>
{text}
diff --git a/src/components/shared/RotateIcon.tsx b/src/components/shared/RotateIcon.tsx
index d291ece..7e3ceae 100644
--- a/src/components/shared/RotateIcon.tsx
+++ b/src/components/shared/RotateIcon.tsx
@@ -4,12 +4,13 @@ import { RotateCw } from 'react-feather';
import s from './RotateIcon.module.scss';
-export function RotateIcon(props: { isRotating: boolean; size?: number }) {
- const size = props.size || 16;
- const cls = cx(s.rotate, { [s.isRotating]: props.isRotating });
+export function RotateIcon({ isRotating }: { isRotating: boolean }) {
+ const cls = cx(s.rotate, {
+ [s.isRotating]: isRotating,
+ });
return (
<span className={cls}>
- <RotateCw size={size} />
+ <RotateCw width={16} />
</span>
);
}
diff --git a/src/components/shared/TextFitler.tsx b/src/components/shared/TextFitler.tsx
index 7af61ac..e4a4a88 100644
--- a/src/components/shared/TextFitler.tsx
+++ b/src/components/shared/TextFitler.tsx
@@ -4,7 +4,10 @@ import { useTextInut } from 'src/hooks/useTextInput';
import s from './TextFitler.module.scss';
-export function TextFilter(props: { textAtom: RecoilState<string>; placeholder?: string }) {
+export function TextFilter(props: {
+ textAtom: RecoilState<string>;
+ placeholder?: string;
+}) {
const [onChange, text] = useTextInut(props.textAtom);
return (
<input
diff --git a/src/components/shared/ThemeSwitcher.module.scss b/src/components/shared/ThemeSwitcher.module.scss
index 951376a..c5de126 100644
--- a/src/components/shared/ThemeSwitcher.module.scss
+++ b/src/components/shared/ThemeSwitcher.module.scss
@@ -29,8 +29,7 @@
height: var(--sz);
select {
cursor: pointer;
- padding-left: calc(var(--sz) - 2px);
- font-size: 0;
+ padding-left: var(--sz);
width: var(--sz);
height: var(--sz);
appearance: none;
diff --git a/src/components/shared/ZapAnimated.module.scss b/src/components/shared/ZapAnimated.module.scss
deleted file mode 100644
index e4cb37b..0000000
--- a/src/components/shared/ZapAnimated.module.scss
+++ /dev/null
@@ -1,12 +0,0 @@
-.animate {
- --saturation: 70%;
- stroke: hsl(46deg var(--saturation) 45%);
- animation: zap-pulse 0.7s 0s ease-in-out none normal infinite;
-}
-
-// prettier-ignore
-@keyframes zap-pulse {
- 0% { stroke: hsl(46deg var(--saturation) 45%); }
- 50% { stroke: hsl(46deg var(--saturation) 95%); }
- 100% { stroke: hsl(46deg var(--saturation) 45%); }
-}
diff --git a/src/components/shared/ZapAnimated.tsx b/src/components/shared/ZapAnimated.tsx
deleted file mode 100644
index e3b153a..0000000
--- a/src/components/shared/ZapAnimated.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import cx from 'clsx';
-import * as React from 'react';
-
-import s from './ZapAnimated.module.scss';
-
-export function ZapAnimated(props: { size?: number; animate?: boolean }) {
- const size = props.size || 24;
- const cls = cx({ [s.animate]: props.animate });
- return (
- <svg
- className={cls}
- xmlns="http://www.w3.org/2000/svg"
- width={size}
- height={size}
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- >
- <polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" />
- </svg>
- );
-}