Skip to content

Commit

Permalink
fix(format): code Formatting done
Browse files Browse the repository at this point in the history
  • Loading branch information
yokesh-ks committed Oct 10, 2023
1 parent 6445497 commit e0bb8ab
Show file tree
Hide file tree
Showing 100 changed files with 6,293 additions and 4,038 deletions.
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
'^@/icon/(.*)$',
'^@/store/(.*)$',
'^@/lib/(.*)$',
'^@/radix-ui/(.*)$',
'^@radix-ui/(.*)$',
'^@/utils/(.*)$',
'^@/(.*)$',
'^@/emails/(.*)$',
Expand Down
56 changes: 28 additions & 28 deletions app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
import globby from "globby";
import { MetadataRoute } from "next";
import globby from 'globby'
import { MetadataRoute } from 'next'

export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const pages = await globby([
"pages/*.tsx",
"pages/*/*.tsx",
"!pages/api",
"!pages/404.tsx",
"!pages/sitemap.ts",
"!pages/_app.tsx",
"!pages/_document.tsx",
"!pages/pdf-to-word.tsx",
"!pages/color-magic.tsx",
]);
const urls: MetadataRoute.Sitemap = [];
'pages/*.tsx',
'pages/*/*.tsx',
'!pages/api',
'!pages/404.tsx',
'!pages/sitemap.ts',
'!pages/_app.tsx',
'!pages/_document.tsx',
'!pages/pdf-to-word.tsx',
'!pages/color-magic.tsx',
])
const urls: MetadataRoute.Sitemap = []
pages.map((page) => {
const path = page
.replace("pages", "")
.replace("data", "")
.replace(".tsx", "")
.replace(".mdx", "");
.replace('pages', '')
.replace('data', '')
.replace('.tsx', '')
.replace('.mdx', '')

const excludedPaths = [/^\/[^/]*\/index$/]; // Regular expressions to match paths like /blogs/index, /category/index, etc.
const excludedPaths = [/^\/[^/]*\/index$/] // Regular expressions to match paths like /blogs/index, /category/index, etc.

const isExcluded = excludedPaths.some((regex) => regex.test(path));
const isExcluded = excludedPaths.some((regex) => regex.test(path))

let route = path;
let route = path

if (path === "/index") {
route = "";
if (path === '/index') {
route = ''
} else if (isExcluded) {
route = path.replace(/\/index$/, "");
route = path.replace(/\/index$/, '')
} else {
route = path;
route = path
}

urls.push({
url: `https://topological-materials.vercel.app${route}`,
lastModified: new Date(),
});
return;
});
})
return
})

return urls;
return urls
}
4 changes: 2 additions & 2 deletions next-sitemap.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @type {import('next-sitemap').IConfig} */
module.exports = {
siteUrl: process.env.SITE_URL || "https://topological-materials.vercel.app",
siteUrl: process.env.SITE_URL || 'https://topological-materials.vercel.app',
generateRobotsTxt: true, // (optional)
// ...other options
};
}
28 changes: 14 additions & 14 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
});
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})

module.exports = withBundleAnalyzer({
reactStrictMode: true,
});
})

module.exports = (phase, { defaultConfig }) => {
return {
Expand All @@ -18,15 +18,15 @@ module.exports = (phase, { defaultConfig }) => {
path: false,
os: false,
},
};
return config;
}
return config
},
};
};
}
}

// Injected content via Sentry wizard below

const { withSentryConfig } = require("@sentry/nextjs");
const { withSentryConfig } = require('@sentry/nextjs')

module.exports = withSentryConfig(
module.exports,
Expand All @@ -51,20 +51,20 @@ module.exports = withSentryConfig(
transpileClientSDK: true,

// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
tunnelRoute: "/monitoring",
tunnelRoute: '/monitoring',

// Hides source maps from generated client bundles
hideSourceMaps: true,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
}
);
},
)

const withPWA = require('next-pwa')({
dest: 'public'
dest: 'public',
})

module.exports = withPWA({
// next.js config
})
})
57 changes: 29 additions & 28 deletions pages/404.tsx
Original file line number Diff line number Diff line change
@@ -1,53 +1,54 @@
import { Button } from "@/components/ui/button";
import { Icon } from "@/icon";
import { Card } from "@/components/ui/card";
import { Button } from '@/components/ui/button'
import { Card } from '@/components/ui/card'

import { Icon } from '@/icon'

export default function NotFound() {
return (
<section>
<div className="container flex items-center justify-center min-h-screen px-6 py-12 mx-auto">
<div className="w-full ">
<div className="flex flex-col items-center max-w-lg mx-auto text-center">
<p className="text-sm font-medium">404 error</p>
<h1 className="mt-3 text-2xl font-semibold md:text-3xl">
<div className='container flex items-center justify-center min-h-screen px-6 py-12 mx-auto'>
<div className='w-full '>
<div className='flex flex-col items-center max-w-lg mx-auto text-center'>
<p className='text-sm font-medium'>404 error</p>
<h1 className='mt-3 text-2xl font-semibold md:text-3xl'>
We lost this page
</h1>
<p className="mt-4">
<p className='mt-4'>
We searched high and low, but couldn’t find what you’re looking
for.Let’s find a better place for you to go.
</p>

<div className="flex items-center w-full mt-6 gap-x-3 shrink-0 sm:w-auto">
<div className='flex items-center w-full mt-6 gap-x-3 shrink-0 sm:w-auto'>
<Button>Take me home</Button>
</div>
</div>

<div className="grid w-full max-w-6xl grid-cols-1 gap-8 mx-auto mt-8 sm:grid-cols-2 lg:grid-cols-3">
<Card className="p-6">
<Icon name="FileText" className="w-6 h-6" />
<h3 className="mt-6 font-medium">Documentation</h3>
<p className="mt-2 ">Dive in to learn all about our product.</p>
<a href="#" className="inline-flex items-center mt-4 text-sm">
<div className='grid w-full max-w-6xl grid-cols-1 gap-8 mx-auto mt-8 sm:grid-cols-2 lg:grid-cols-3'>
<Card className='p-6'>
<Icon name='FileText' className='w-6 h-6' />
<h3 className='mt-6 font-medium'>Documentation</h3>
<p className='mt-2 '>Dive in to learn all about our product.</p>
<a href='#' className='inline-flex items-center mt-4 text-sm'>
<span>Start learning &rarr;</span>
</a>
</Card>

<Card className="p-6">
<Icon name="BookOpen" className="w-6 h-6" />
<h3 className="mt-6 font-medium ">Our blog</h3>
<p className="mt-2 ">Read the latest posts on our blog.</p>
<a href="#" className="inline-flex items-center mt-4 text-sm">
<Card className='p-6'>
<Icon name='BookOpen' className='w-6 h-6' />
<h3 className='mt-6 font-medium '>Our blog</h3>
<p className='mt-2 '>Read the latest posts on our blog.</p>
<a href='#' className='inline-flex items-center mt-4 text-sm'>
<span>View lastest posts &rarr;</span>
</a>
</Card>

<Card className="p-6">
<Icon name="MessageCircle" className="w-6 h-6" />
<h3 className="mt-6 font-medium">Chat to us</h3>
<p className="mt-2">Can’t find what you’re looking for?</p>
<Card className='p-6'>
<Icon name='MessageCircle' className='w-6 h-6' />
<h3 className='mt-6 font-medium'>Chat to us</h3>
<p className='mt-2'>Can’t find what you’re looking for?</p>
<a
href="#"
className="inline-flex items-center mt-4 text-sm hover:underline"
href='#'
className='inline-flex items-center mt-4 text-sm hover:underline'
>
<span>Chat to our team &rarr;</span>
</a>
Expand All @@ -56,5 +57,5 @@ export default function NotFound() {
</div>
</div>
</section>
);
)
}
22 changes: 12 additions & 10 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
import "../src/styles/index.css";
import { ThemeProvider } from "@/components/common/providers";
import { Inter } from "next/font/google";
import { Header } from "@/components/common/Header";
import { Toaster } from "@/components/ui/toaster";
import { Meta } from "@/components/meta";
import { Inter } from 'next/font/google'

const inter = Inter({ subsets: ["latin"] });
import { Header } from '@/components/common/Header'
import { ThemeProvider } from '@/components/common/providers'
import { Meta } from '@/components/meta'
import { Toaster } from '@/components/ui/toaster'

import '../src/styles/index.css'

const inter = Inter({ subsets: ['latin'] })

function MyApp({ Component, pageProps }) {
return (
<div className={inter.className}>
<Meta />
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
<ThemeProvider attribute='class' defaultTheme='system' enableSystem>
<Header />
<Component {...pageProps} />
<Toaster />
</ThemeProvider>
</div>
);
)
}

export default MyApp;
export default MyApp
48 changes: 24 additions & 24 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import Document, { Head, Html, Main, NextScript } from "next/document";
import { ServerStyleSheet } from "styled-components";
import Document, { Head, Html, Main, NextScript } from 'next/document'
import { ServerStyleSheet } from 'styled-components'

export default class MyDocument extends Document {
static async getInitialProps(ctx) {
const sheet = new ServerStyleSheet();
const originalRenderPage = ctx.renderPage;
const sheet = new ServerStyleSheet()
const originalRenderPage = ctx.renderPage

try {
ctx.renderPage = () =>
originalRenderPage({
enhanceApp: (App) => (props) =>
sheet.collectStyles(<App {...props} />),
});
})

const initialProps = await Document.getInitialProps(ctx);
const initialProps = await Document.getInitialProps(ctx)
return {
...initialProps,
styles: (
Expand All @@ -22,41 +22,41 @@ export default class MyDocument extends Document {
{sheet.getStyleElement()}
</>
),
};
}
} finally {
sheet.seal();
sheet.seal()
}
}
render() {
return (
<Html lang="en-GB">
<Html lang='en-GB'>
<Head>
<meta name="application-name" content="Tool Empire" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name='application-name' content='Tool Empire' />
<meta name='apple-mobile-web-app-capable' content='yes' />
<meta
name="apple-mobile-web-app-status-bar-style"
content="default"
name='apple-mobile-web-app-status-bar-style'
content='default'
/>
<meta name="apple-mobile-web-app-title" content="Tool Empire" />
<meta name='apple-mobile-web-app-title' content='Tool Empire' />
<meta
name="description"
content="Innovative tools for empire builders."
name='description'
content='Innovative tools for empire builders.'
/>
<meta name="format-detection" content="telephone=no" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="theme-color" content="#000000" />
<meta name='format-detection' content='telephone=no' />
<meta name='mobile-web-app-capable' content='yes' />
<meta name='theme-color' content='#000000' />
<link
href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap"
rel="stylesheet"
href='https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap'
rel='stylesheet'
/>
<link rel="manifest" href="/manifest.json" />
<link rel="icon" type="image/x-icon" href="/favicon.png"></link>
<link rel='manifest' href='/manifest.json' />
<link rel='icon' type='image/x-icon' href='/favicon.png'></link>
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
);
)
}
}
2 changes: 1 addition & 1 deletion pages/api/hello.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction

export default function handler(req, res) {
res.status(200).json({ name: "John Doe" });
res.status(200).json({ name: 'John Doe' })
}
Loading

0 comments on commit e0bb8ab

Please sign in to comment.