Last active
October 27, 2022 12:08
-
-
Save renderlife/31b19381764319f367eec4999498de47 to your computer and use it in GitHub Desktop.
ts_component.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Libs | |
// Styles | |
import styles from './styles.module.sass' | |
import commonStyles from '@Styles/common.module.sass' | |
import cn from 'classnames' | |
// Utils | |
// Components | |
import AuthInput from '@Components/Common/Inputs/AuthInput/AuthInput' | |
// Icons | |
import { ReactComponent as CommentIcon } from 'Images/comment-black.svg' | |
// Constants | |
import { AUTH_PATH } from '@Constants/patch' | |
// Types and Models | |
import { SettingsType } from '@Types/settings.d' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Libs | |
// Styles | |
// Utils | |
// Components | |
// Icons | |
// Constants | |
// Types and Models |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const foo = useMemo(() => { | |
return bar | |
}, [baz]) | |
const handleFoo = useCallback((value) => { | |
onChange(value) | |
}, [onChange]) | |
const [foo, setFoo] = useState<Boolean>(true) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useCallback } from 'react' | |
import commonStyles from '@Styles/common.module.sass' | |
import styles from './styles.module.sass' | |
import cn from 'classnames' | |
export type Props = { | |
id: number | |
onClick: (id: number) => void | |
title: string | |
} | |
export default function ButtonAsLink(props: Props): JSX.Element { | |
const { id, onClick, title } = props | |
const handleClick = useCallback(() => { | |
onClick(id) | |
}, [id, onClick]) | |
return ( | |
<div className={styles.link} onClick={handleClick} title={title}> | |
{title} | |
</div> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment