Skip to content

Commit

Permalink
fix: try to fix hydration error
Browse files Browse the repository at this point in the history
  • Loading branch information
tfkhdyt committed Jul 7, 2024
1 parent 471775f commit f02ca3c
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 35 deletions.
8 changes: 4 additions & 4 deletions src/app/(dashboard)/users/[username]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,22 @@ export default async function UserPage({
{user.name}
</p>
<UserStat username={user.username} />
<p className='hidden text-sm md:block md:text-base'>
<span className='hidden text-sm md:block md:text-base'>
Bergabung sejak{' '}
<span title={formatLongDateTime(user.createdAt)}>
{dayjs(user.createdAt).format('D MMMM YYYY')}
</span>
</p>
</span>
</div>
</div>
<div className='m-4 mb-6 space-y-1 text-[#696984] md:hidden'>
<p className='line-clamp-1 font-medium md:text-lg'>{user.name}</p>
<p className='text-sm'>
<span className='text-sm'>
Bergabung sejak{' '}
<span title={formatLongDateTime(user.createdAt)}>
{dayjs(user.createdAt).format('D MMMM YYYY')}
</span>
</p>
</span>
</div>
<div className='w-full'>
<UserTabs
Expand Down
16 changes: 8 additions & 8 deletions src/app/(landing-page)/fitur.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ export function Fitur() {
className='scroll-mt-20 bg-[url(/img/fitur/bg_2.svg)] bg-cover pb-32 pt-12'
id='fitur'
>
<div className='container space-y-12 md:px-12'>
<p className='text-center text-2xl font-bold text-[#F48C06]'>
<div className='container space-y-6 md:px-12'>
<div className='text-center text-2xl font-bold text-[#F48C06]'>
<span className='text-[#77425A]'>Fitur</span> Kami
</p>
</div>
<p className='text-center leading-loose text-[#696984]'>
Fitur yang sangat luar biasa ini, dapat membuat kegiatan belajar
menjadi lebih efisien
</p>
{fitur.map((each, index) => (
<section
className={clsx(
'flex scroll-mt-20 flex-col items-center gap-8 pt-12 md:flex-row lg:pt-20',
'flex scroll-mt-20 flex-col items-center gap-8 pt-12 md:flex-row',
index % 2 === 1 && 'md:flex-row-reverse',
)}
id={each.image.alt.replaceAll(' ', '-').toLowerCase()}
Expand All @@ -82,22 +82,22 @@ export function Fitur() {
<div className='space-y-8 md:w-1/2 md:p-6 lg:p-32'>
{match(index % 2)
.with(0, () => (
<p className='text-center text-2xl font-extrabold text-[#77425A]'>
<div className='text-center text-2xl font-extrabold text-[#77425A]'>
<span className='text-[#F48C06]'>{each.title[0]}</span>{' '}
{each.title[1]}
{each.isComingSoon && (
<span className='text-xs'> (Coming soon)</span>
)}
</p>
</div>
))
.otherwise(() => (
<p className='text-center text-2xl font-extrabold text-[#F48C06]'>
<div className='text-center text-2xl font-extrabold text-[#F48C06]'>
<span className='text-[#77425A]'>{each.title[0]}</span>{' '}
{each.title[1]}
{each.isComingSoon && (
<span className='text-xs'> (Coming soon)</span>
)}
</p>
</div>
))}

<p className='text-center leading-loose text-[#696984]'>
Expand Down
4 changes: 2 additions & 2 deletions src/app/(landing-page)/keunggulan.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ export function Keunggulan() {
id='keunggulan'
>
<div className='container space-y-12 md:px-16'>
<p className='text-center text-2xl font-bold text-[#F48C06]'>
<div className='text-center text-2xl font-bold text-[#F48C06] mx-auto w-full'>
<span className='text-[#77425A]'>Keunggulan</span> Platform Kami
</p>
</div>
<p className='mx-auto max-w-4xl text-center leading-loose text-[#696984] md:text-lg md:leading-loose'>
Yukitanya adalah salah satu platform tanya jawab online yang
menggabungkan semua alat yang diperlukan untuk menunjang tugas
Expand Down
4 changes: 2 additions & 2 deletions src/app/(landing-page)/mata-pelajaran.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ export function MataPelajaran() {
id='tentang-kami'
>
<div className='container space-y-16 text-[#696984] md:px-12'>
<p className='text-center text-2xl font-bold text-[#77425A]'>
<div className='text-center text-2xl font-bold text-[#77425A]'>
Yuk tanya{' '}
<span className='text-[#F48C06]'>pelajaran favoritmu disini!</span>
</p>
</div>
<div className='grid grid-cols-2 gap-6 md:grid-cols-3 lg:grid-cols-7'>
{mapel.map((each) => (
<div className='flex flex-col items-center' key={each.name}>
Expand Down
4 changes: 2 additions & 2 deletions src/app/(landing-page)/tentang-kami.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ export function TentangKami() {
return (
<section className='bg-[url(/img/tentang_kami_bg.svg)] bg-cover pt-10'>
<div className='container space-y-12 md:px-16'>
<p className='text-center text-2xl font-bold text-[#77425A]'>
<div className='text-center text-2xl font-bold text-[#77425A]'>
<span className='text-[#F48C06]'>Apa itu</span> Yukitanya?
</p>
</div>
<p className='mx-auto max-w-4xl text-center leading-loose text-[#696984] lg:text-lg lg:leading-loose'>
Yukitanya adalah sebuah website yang menghubungkan banyak siswa ke
dalam sebuah forum diskusi untuk menyelesaikan tugas sekolah secara
Expand Down
4 changes: 2 additions & 2 deletions src/app/_components/modals/answer-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export function AnswerModal({
</FormItem>
)}
/>
<p className='text-right text-[#696984]'>
<div className='text-right text-[#696984]'>
<span
className={clsx(
answerLength > 1000 && 'font-semibold text-red-700',
Expand All @@ -236,7 +236,7 @@ export function AnswerModal({
{answerLength}
</span>
/1000
</p>
</div>
<div className='flex justify-between flex-wrap-reverse gap-4 items-center'>
<Turnstile
siteKey={environment.NEXT_PUBLIC_TURNSTILE_SITE_KEY}
Expand Down
4 changes: 2 additions & 2 deletions src/app/_components/modals/edit-answer-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export function EditAnswerModal({
</FormItem>
)}
/>
<p className='text-right text-[#696984]'>
<div className='text-right text-[#696984]'>
<span
className={clsx(
answerLength > 1000 && 'font-semibold text-red-700',
Expand All @@ -236,7 +236,7 @@ export function EditAnswerModal({
{answerLength}
</span>
/1000
</p>
</div>
<div className='flex justify-between flex-wrap-reverse gap-4 items-center'>
<Turnstile
siteKey={environment.NEXT_PUBLIC_TURNSTILE_SITE_KEY}
Expand Down
4 changes: 2 additions & 2 deletions src/app/auth/sign-in/signin-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,15 @@ export function SigninForm() {
<Facebook color='black' />
</Button>
</div>
<p className='mt-4 text-center text-sm font-medium'>
<div className='mt-4 text-center text-sm font-medium'>
Belum punya akun?{' '}
<Link
className='font-semibold text-[#00B6EF] underline'
href='/auth/sign-up'
>
Daftar
</Link>
</p>
</div>
</>
);
}
22 changes: 11 additions & 11 deletions src/app/auth/sign-up/signup-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { zodResolver } from '@hookform/resolvers/zod';
import { Turnstile, type TurnstileInstance } from '@marsidev/react-turnstile';
import { Eye, EyeOff, Facebook } from 'lucide-react';
import { Eye, EyeOff, FacebookIcon } from 'lucide-react';
import { signIn } from 'next-auth/react';
import Image from 'next/image';
import Link from 'next/link';
Expand Down Expand Up @@ -49,12 +49,12 @@ const usePasswordStrength = (password: string) => {
const [result, setResult] = useState<ZxcvbnResult | undefined>();
const deferredPassword = useDebounce(password, 500);

const calculatePwdStrength = async (pwd: string) => {
const response = await zxcvbnAsync(pwd);
setResult(response);
};

useEffect(() => {
const calculatePwdStrength = async (pwd: string) => {
const response = await zxcvbnAsync(pwd);
setResult(response);
};

if (deferredPassword) {
calculatePwdStrength(deferredPassword);
}
Expand Down Expand Up @@ -190,7 +190,7 @@ export function SignupForm() {
<FormItem>
<FormLabel>Password</FormLabel>
<FormControl>
<>
<div>
<span className='flex space-x-2'>
<Input
placeholder='Password'
Expand Down Expand Up @@ -238,7 +238,7 @@ export function SignupForm() {
.otherwise(() => 'Empty')}
</span>
</div>
</>
</div>
</FormControl>
<FormMessage />
</FormItem>
Expand Down Expand Up @@ -327,18 +327,18 @@ export function SignupForm() {
})
}
>
<Facebook color='black' />
<FacebookIcon color='black' />
</Button>
</div>
<p className='mt-4 text-center text-sm font-medium'>
<div className='mt-4 text-center text-sm font-medium'>
Sudah punya akun?{' '}
<Link
className='font-semibold text-[#00B6EF] underline'
href='/auth/sign-in'
>
Masuk
</Link>
</p>
</div>
</>
);
}

0 comments on commit f02ca3c

Please sign in to comment.