Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Commit

Permalink
chore: merge branch
Browse files Browse the repository at this point in the history
  • Loading branch information
shalluv committed Jul 11, 2023
2 parents 68d7a96 + f49a4ee commit d6ad083
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 25 deletions.
48 changes: 23 additions & 25 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,37 +62,35 @@ function MetaData() {

export default function App({ Component, pageProps }: AppProps) {
return (
<AuthProvider>
<main className={`${ibmPlexSansThai.variable} font-ibm text-white`}>
<ToastProvider>
<MetaData />
<AuthProvider>
<MetaData />

<main
className={`${ibmPlexSansThai.variable} font-ibm text-white`}
>
<Navbar />
<Component {...pageProps} />
<Background />
<Footer />
</main>

<Analytics />
<Script
async
src="https://www.googletagmanager.com/gtag/js?id=G-0ZFDD1EKVW"
/>
<Script
id="google-analytics"
dangerouslySetInnerHTML={{
__html: `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-0ZFDD1EKVW');
`,
}}
/>
</AuthProvider>
</ToastProvider>
</AuthProvider>

<Analytics />
<Script
async
src="https://www.googletagmanager.com/gtag/js?id=G-0ZFDD1EKVW"
/>
<Script
id="google-analytics"
dangerouslySetInnerHTML={{
__html: `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-0ZFDD1EKVW');
`,
}}
/>
</main>
);
}
10 changes: 10 additions & 0 deletions src/pages/register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ const Register = () => {
formData.append('tag', '1');
formData.append('type', '1');

// if file larger than 10mb
const TEN_MB = 10 * 1024 * 1024;
if (file.size > TEN_MB) {
toast?.setToast('error', 'ไฟล์มีขนาดใหญ่เกิน 10 MB');
return;
}

try {
const { data } = await httpPost<
FormData,
Expand Down Expand Up @@ -273,6 +280,9 @@ const Register = () => {
<span className="text-xs">แก้ไข</span>
</div>
</div>
<span className="text-center text-sm font-extralight text-purple/50">
รูปภาพจะต้องมีขนาดไม่เกิน 10MB
</span>
<input
id="image"
name="image"
Expand Down

0 comments on commit d6ad083

Please sign in to comment.