Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: format codebase using @prettier #47

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"extends": [
"next/core-web-vitals",
"plugin:storybook/recommended"
]
"extends": ["next/core-web-vitals", "plugin:storybook/recommended"]
}
2 changes: 1 addition & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const config: StorybookConfig = {
'@storybook/addon-onboarding',
'@storybook/addon-interactions',
'@storybook/addon-themes',
'@storybook/addon-a11y'
'@storybook/addon-a11y',
],
framework: {
name: '@storybook/nextjs',
Expand Down
2 changes: 1 addition & 1 deletion app/(blog)/[slug]/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const dynamicParams = false;

const getFormattedDate = (date) => date;

export async function generateMetadata({ params}) {
export async function generateMetadata({ params }) {
const post = await findPostBySlug(params.slug);
if (!post) {
return notFound();
Expand Down
2 changes: 1 addition & 1 deletion app/(blog)/blog/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default async function Home({}) {
</h1>
</header>
<div className="grid grid-cols-1 gap-6 p-4 md:p-0 lg:grid-cols-2">
{posts.map(({ slug, title, image }: { slug: string, title: string, image: string }) => (
{posts.map(({ slug, title, image }: { slug: string; title: string; image: string }) => (
<div key={slug} className="flex flex-col overflow-hidden rounded-xl border border-gray-200 shadow-lg">
<Link href={`/${slug}`}>
<Image width={650} height={340} alt={title} src={`${image}`} />
Expand Down
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ module.exports = {
hostname: 'source.unsplash.com',
},
],
}
},
};
2 changes: 1 addition & 1 deletion src/components/atoms/Providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { ThemeProvider } from 'next-themes';

export interface ProvidersProps {
children: React.ReactNode
children: React.ReactNode;
}

const Providers = ({ children }: ProvidersProps) => (
Expand Down
8 changes: 4 additions & 4 deletions src/components/common/ItemGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ const ItemGrid = ({
(columns || defaultColumns) === 4
? 'lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2'
: (columns || defaultColumns) === 3
? 'lg:grid-cols-3 sm:grid-cols-2'
: (columns || defaultColumns) === 2
? 'sm:grid-cols-2'
: 'max-w-4xl'
? 'lg:grid-cols-3 sm:grid-cols-2'
: (columns || defaultColumns) === 2
? 'sm:grid-cols-2'
: 'max-w-4xl'
}`,
containerClass,
)}
Expand Down
77 changes: 41 additions & 36 deletions src/stories/Configure.mdx
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
import { Meta } from "@storybook/blocks";
import Image from "next/image";

import Github from "./assets/github.svg";
import Discord from "./assets/discord.svg";
import Youtube from "./assets/youtube.svg";
import Tutorials from "./assets/tutorials.svg";
import Styling from "./assets/styling.png";
import Context from "./assets/context.png";
import Assets from "./assets/assets.png";
import Docs from "./assets/docs.png";
import Share from "./assets/share.png";
import FigmaPlugin from "./assets/figma-plugin.png";
import Testing from "./assets/testing.png";
import Accessibility from "./assets/accessibility.png";
import Theming from "./assets/theming.png";
import AddonLibrary from "./assets/addon-library.png";

export const RightArrow = () => <svg
viewBox="0 0 14 14"
width="8px"
height="14px"
style={{
import { Meta } from '@storybook/blocks';
import Image from 'next/image';

import Github from './assets/github.svg';
import Discord from './assets/discord.svg';
import Youtube from './assets/youtube.svg';
import Tutorials from './assets/tutorials.svg';
import Styling from './assets/styling.png';
import Context from './assets/context.png';
import Assets from './assets/assets.png';
import Docs from './assets/docs.png';
import Share from './assets/share.png';
import FigmaPlugin from './assets/figma-plugin.png';
import Testing from './assets/testing.png';
import Accessibility from './assets/accessibility.png';
import Theming from './assets/theming.png';
import AddonLibrary from './assets/addon-library.png';

export const RightArrow = () => (
<svg
viewBox="0 0 14 14"
width="8px"
height="14px"
style={{
marginLeft: '4px',
display: 'inline-block',
shapeRendering: 'inherit',
verticalAlign: 'middle',
fill: 'currentColor',
'path fill': 'currentColor'
'path fill': 'currentColor',
}}
>
<path d="m11.1 7.35-5.5 5.5a.5.5 0 0 1-.7-.7L10.04 7 4.9 1.85a.5.5 0 1 1 .7-.7l5.5 5.5c.2.2.2.5 0 .7Z" />
</svg>
>
<path d="m11.1 7.35-5.5 5.5a.5.5 0 0 1-.7-.7L10.04 7 4.9 1.85a.5.5 0 1 1 .7-.7l5.5 5.5c.2.2.2.5 0 .7Z" />
</svg>
);

<Meta title="Configure your project" />

Expand All @@ -39,6 +41,7 @@ export const RightArrow = () => <svg
# Configure your project

Because Storybook works separately from your app, you'll need to configure it for your specific stack and setup. Below, explore guides for configuring Storybook with popular frameworks and tools. If you get stuck, learn how you can ask for help from our community.

</div>
<div className="sb-section">
<div className="sb-section-item">
Expand Down Expand Up @@ -97,6 +100,7 @@ export const RightArrow = () => <svg
# Do more with Storybook

Now that you know the basics, let's explore other parts of Storybook that will improve your experience. This list is just to get you started. You can customise Storybook in many ways to fit your needs.

</div>

<div className="sb-section">
Expand Down Expand Up @@ -234,12 +238,12 @@ export const RightArrow = () => <svg
>Star on GitHub<RightArrow /></a>
</div>
<div className="sb-section-item">
<Image
<Image
width={33}
height={32}
layout="fixed"
src={Discord}
alt="Discord logo"
src={Discord}
alt="Discord logo"
className="sb-explore-image"
/>
<div>
Expand All @@ -252,12 +256,12 @@ export const RightArrow = () => <svg
</div>
</div>
<div className="sb-section-item">
<Image
<Image
width={32}
height={32}
layout="fixed"
src={Youtube}
alt="Youtube logo"
src={Youtube}
alt="Youtube logo"
className="sb-explore-image"
/>
<div>
Expand All @@ -270,12 +274,12 @@ export const RightArrow = () => <svg
</div>
</div>
<div className="sb-section-item">
<Image
<Image
width={33}
height={32}
layout="fixed"
src={Tutorials}
alt="A book"
src={Tutorials}
alt="A book"
className="sb-explore-image"
/>
<p>Follow guided walkthroughs on for key workflows.</p>
Expand All @@ -285,6 +289,7 @@ export const RightArrow = () => <svg
target="_blank"
>Discover tutorials<RightArrow /></a>
</div>

</div>

<style>
Expand Down
19 changes: 13 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,21 @@
"incremental": true,
"baseUrl": ".",
"paths": {
"~/*": ["src/*"]
"~/*": ["src/*"],
},
"plugins": [
{
"name": "next"
}
]
"name": "next",
},
],
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "app/(blog)/blog/page.tsx", "app/(blog)/[slug]/page.jsx"],
"exclude": ["node_modules"]
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
"app/(blog)/blog/page.tsx",
"app/(blog)/[slug]/page.jsx",
],
"exclude": ["node_modules"],
}