summaryrefslogtreecommitdiff
path: root/src/components/shared
diff options
context:
space:
mode:
authorHaishan <[email protected]>2022-06-06 23:39:56 +0800
committerHaishan <[email protected]>2022-06-06 23:39:56 +0800
commit78f3434cb52f53c66936de278f0828c19ef63666 (patch)
treee7f9685cc0f3d8eaa6a94ad330e8876752ecb276 /src/components/shared
parent23e734aa548354bb7ceff5ad8d85de95cd860a55 (diff)
Run prettier
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
3 files changed, 8 insertions, 18 deletions
diff --git a/src/components/shared/Fab.tsx b/src/components/shared/Fab.tsx
index 832306e..8e72432 100644
--- a/src/components/shared/Fab.tsx
+++ b/src/components/shared/Fab.tsx
@@ -28,8 +28,7 @@ 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;
}
@@ -77,10 +76,7 @@ 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(() => {
@@ -141,9 +137,7 @@ 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 d9dcbd9..d291ece 100644
--- a/src/components/shared/RotateIcon.tsx
+++ b/src/components/shared/RotateIcon.tsx
@@ -4,13 +4,12 @@ import { RotateCw } from 'react-feather';
import s from './RotateIcon.module.scss';
-export function RotateIcon({ isRotating }: { isRotating: boolean }) {
- const cls = cx(s.rotate, {
- [s.isRotating]: isRotating,
- });
+export function RotateIcon(props: { isRotating: boolean; size?: number }) {
+ const size = props.size || 16;
+ const cls = cx(s.rotate, { [s.isRotating]: props.isRotating });
return (
<span className={cls}>
- <RotateCw size={16} />
+ <RotateCw size={size} />
</span>
);
}
diff --git a/src/components/shared/TextFitler.tsx b/src/components/shared/TextFitler.tsx
index e4a4a88..7af61ac 100644
--- a/src/components/shared/TextFitler.tsx
+++ b/src/components/shared/TextFitler.tsx
@@ -4,10 +4,7 @@ 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