1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2025-05-29 22:37:44 +02:00

chore: usage of prettier, eslint and lint-staged instead of ts-standard

This commit is contained in:
divlo
2021-04-27 19:09:33 +02:00
parent 2a24af7c47
commit 0901b07611
34 changed files with 1574 additions and 1152 deletions

View File

@ -17,15 +17,11 @@ export const FormResult: React.FC<FormResultProps> = (props) => {
if (state === 'loading' || state === 'success') {
return (
<FormState state={state}>
{t(`home:contact.result.${state}`)}
</FormState>
<FormState state={state}>{t(`home:contact.result.${state}`)}</FormState>
)
}
return (
<FormState state='error'>
{t(`home:contact.result.${state}`)}
</FormState>
<FormState state='error'>{t(`home:contact.result.${state}`)}</FormState>
)
}

View File

@ -5,7 +5,7 @@ export interface FormStateProps extends React.ComponentPropsWithRef<'p'> {
children: string
}
export const FormState: React.FC<FormStateProps> = props => {
export const FormState: React.FC<FormStateProps> = (props) => {
const { state, children, ...rest } = props
const { t } = useTranslation()
@ -15,24 +15,28 @@ export const FormState: React.FC<FormStateProps> = props => {
<p className={state} {...rest}>
{['error', 'success'].includes(state) && (
<b>
{state === 'error' ? t('home:contact.error') : t('home:contact.success')}:
{state === 'error'
? t('home:contact.error')
: t('home:contact.success')}
:
</b>
)}{' '}
{children}
</p>
</div>
<style jsx>{`
.form-result {
margin: 30px;
}
.success {
color: #90ee90;
}
.error {
color: #ff7f7f;
}
`}
<style jsx>
{`
.form-result {
margin: 30px;
}
.success {
color: #90ee90;
}
.error {
color: #ff7f7f;
}
`}
</style>
</>
)