Skip to content

Commit

Permalink
fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
feralislatr committed Jul 7, 2023
1 parent a86f73b commit 3cfcd7b
Show file tree
Hide file tree
Showing 11 changed files with 162 additions and 164 deletions.
29 changes: 0 additions & 29 deletions .eslintrc-auto-import.json

This file was deleted.

8 changes: 6 additions & 2 deletions db/queries/Term.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import { Term } from '~/db/schema'

export const allTerms = (): string => `{
export function allTerms(): string {
return `{
allTerms {
data {
${Term}
}
}
}`
}

export const findTermById = (id: number): string => `{
export function findTermById(id: number): string {
return `{
findTermById(${id}) {
${Term}
}
}`
}

export default {
allTerms,
Expand Down
2 changes: 1 addition & 1 deletion hooks/media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { breakpoints as breakpointsRaw } from '../uno.config.breakpoints'
const breakpoints = Object.entries(breakpointsRaw).reduce(
(acc, [k, v]) => ({
...acc,
[k]: parseInt(v.replace('px', ''), 10),
[k]: Number.parseInt(v.replace('px', ''), 10),
}),
{} as { [P in keyof typeof breakpointsRaw]: number }
)
Expand Down
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const UnoCSS = require('@unocss/webpack').default
const AutoImport = require('unplugin-auto-import/webpack')
const { FileSystemIconLoader } = require('unplugin-icons/loaders')
const IconsResolver = require('unplugin-icons/resolver')
const Icons = require('unplugin-icons/webpack')
const UnoCSS = require('@unocss/webpack').default

/** @type {import('next').NextConfig} */
module.exports = {
Expand Down
26 changes: 14 additions & 12 deletions stories/avatar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@ export default {
title: 'Avatar',
}

export const AvatarWithFallback = () => (
<Avatar>
<AvatarImage
src='https://upload.wikimedia.org/wikipedia/en/e/ed/Nyan_cat_250px_frame.PNG'
alt='Nyan Cat'
/>
<AvatarFallback>
export function AvatarWithFallback() {
return (
<Avatar>
<AvatarImage
alt='Avatar image'
src='https://assets.foundation.app/xm/dP/QmbTJo9DJwY8vogf4GCUS8nqFnPSSze91GjP6CnFCNxmdP/nft.jpg'
src='https://upload.wikimedia.org/wikipedia/en/e/ed/Nyan_cat_250px_frame.PNG'
alt='Nyan Cat'
/>
</AvatarFallback>
</Avatar>
)
<AvatarFallback>
<AvatarImage
alt='Avatar image'
src='https://assets.foundation.app/xm/dP/QmbTJo9DJwY8vogf4GCUS8nqFnPSSze91GjP6CnFCNxmdP/nft.jpg'
/>
</AvatarFallback>
</Avatar>
)
}
12 changes: 6 additions & 6 deletions stories/button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ export default {
}
export const Ballot = () => <Button className='bg-ballot'>Ballot Button</Button>

export const Greenlit = () => (
<Button className='bg-greenlit'>Greenlit Button</Button>
)
export function Greenlit() {
return <Button className='bg-greenlit'>Greenlit Button</Button>
}

export const Primary = () => <Button className='bg-yield'>Yield Button</Button>

export const Pop = () => <Button className='bg-pop'>Pop Button</Button>

export const Reject = () => <Button className='bg-reject'>Reject Button</Button>

export const Secondary = () => (
<Button className='btn-secondary'>Secondary Button</Button>
)
export function Secondary() {
return <Button className='btn-secondary'>Secondary Button</Button>
}
68 changes: 37 additions & 31 deletions stories/card.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,45 @@ export default {
title: 'Card',
}

const CardStoryWrapper = ({ children }: any) => {
function CardStoryWrapper({ children }: any) {
return <div style={{ width: '300px' }}>{children}</div>
}

export const Standard = () => (
<CardStoryWrapper>
<Card>
<h2>Standard Card Heading</h2>
<p>Cards can have paragraphs</p>
<Divider />
<CardCTA>Call to Action!</CardCTA>
</Card>
</CardStoryWrapper>
)
export function Standard() {
return (
<CardStoryWrapper>
<Card>
<h2>Standard Card Heading</h2>
<p>Cards can have paragraphs</p>
<Divider />
<CardCTA>Call to Action!</CardCTA>
</Card>
</CardStoryWrapper>
)
}

export const Knockout = () => (
<CardStoryWrapper>
<Card treatment='knockout'>
<h2>Knockout Card Heading</h2>
<p>Cards can have paragraphs</p>
<Divider />
<CardCTA>Call to Action!</CardCTA>
</Card>
</CardStoryWrapper>
)
export function Knockout() {
return (
<CardStoryWrapper>
<Card treatment='knockout'>
<h2>Knockout Card Heading</h2>
<p>Cards can have paragraphs</p>
<Divider />
<CardCTA>Call to Action!</CardCTA>
</Card>
</CardStoryWrapper>
)
}

export const Outline = () => (
<CardStoryWrapper>
<Card treatment='outline'>
<h2>Outline Card Heading</h2>
<p>Cards can have paragraphs</p>
<Divider />
<CardCTA>Call to Action!</CardCTA>
</Card>
</CardStoryWrapper>
)
export function Outline() {
return (
<CardStoryWrapper>
<Card treatment='outline'>
<h2>Outline Card Heading</h2>
<p>Cards can have paragraphs</p>
<Divider />
<CardCTA>Call to Action!</CardCTA>
</Card>
</CardStoryWrapper>
)
}
16 changes: 9 additions & 7 deletions stories/divider.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ export default {
title: 'Divider',
}

export const Standard = () => (
<div>
a divider divides some things
<Divider />
from other things
</div>
)
export function Standard() {
return (
<div>
a divider divides some things
<Divider />
from other things
</div>
)
}
111 changes: 60 additions & 51 deletions stories/modal.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,57 +11,66 @@ export default {
title: 'Modal',
}

export const CloseButtonAndOverlay = () => (
<Modal trigger={<Button>Modal with close icon and overlay</Button>}>
<ModalTitle>Title</ModalTitle>
<ModalDescription className='mb-4'>Description</ModalDescription>
<p className='mb-4'>
Title and description are optional you can add other content as necessary
</p>
<ModalClose asChild>
<Button aria-label='Close'>Close this darn thing</Button>
</ModalClose>
</Modal>
)
export function CloseButtonAndOverlay() {
return (
<Modal trigger={<Button>Modal with close icon and overlay</Button>}>
<ModalTitle>Title</ModalTitle>
<ModalDescription className='mb-4'>Description</ModalDescription>
<p className='mb-4'>
Title and description are optional you can add other content as
necessary
</p>
<ModalClose asChild>
<Button aria-label='Close'>Close this darn thing</Button>
</ModalClose>
</Modal>
)
}

export const NoCloseButton = () => (
<Modal
removeCloseIcon
trigger={<Button>Modal without close icon</Button>}
>
<ModalDescription className='mb-4'>
If you remove the close icon make sure to add your own close button
</ModalDescription>
<ModalClose asChild>
<Button
className='mt-1 p-2 rounded-sm bg-gray-100 transition duration-500 ease-in-out transform hover:-translate-y-1 hover:scale-110'
aria-label='Close'
>
Close
</Button>
</ModalClose>
</Modal>
)
export function NoCloseButton() {
return (
<Modal
removeCloseIcon
trigger={<Button>Modal without close icon</Button>}
>
<ModalDescription className='mb-4'>
If you remove the close icon make sure to add your own close button
</ModalDescription>
<ModalClose asChild>
<Button
className='mt-1 p-2 rounded-sm bg-gray-100 transition duration-500 ease-in-out transform hover:-translate-y-1 hover:scale-110'
aria-label='Close'
>
Close
</Button>
</ModalClose>
</Modal>
)
}

export const NoOverlay = () => (
<Modal
removeOverlay
trigger={<Button>Modal without overlay</Button>}
contentClassName='p-5 ring-black ring-1 rounded-md'
>
<ModalDescription>
You can use the modal without an overlay via the removeOverlay prop
</ModalDescription>
</Modal>
)
export function NoOverlay() {
return (
<Modal
removeOverlay
trigger={<Button>Modal without overlay</Button>}
contentClassName='p-5 ring-black ring-1 rounded-md'
>
<ModalDescription>
You can use the modal without an overlay via the removeOverlay prop
</ModalDescription>
</Modal>
)
}

export const CustomStyling = () => (
<Modal
trigger={<Button>Modal with custom content styling</Button>}
contentClassName='p-5 bg-green-200 rounded-md'
>
<p>
You can modify the modal content styling via the contentClassName prop.
</p>
</Modal>
)
export function CustomStyling() {
return (
<Modal
trigger={<Button>Modal with custom content styling</Button>}
contentClassName='p-5 bg-green-200 rounded-md'
>
<p>
You can modify the modal content styling via the contentClassName prop.
</p>
</Modal>
)
}
30 changes: 16 additions & 14 deletions stories/radio-buttons.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ export default {
title: 'RadioButtons',
}

export const ButtonBar = () => (
<RadioButtons>
<RadioButton value='radio-button-1'>
<RadioIndicator /> Option 1
</RadioButton>
<RadioButton value='radio-button-2'>
<RadioIndicator /> Option 2
</RadioButton>
<RadioButton value='radio-button-3'>
<RadioIndicator />
Option 3
</RadioButton>
</RadioButtons>
)
export function ButtonBar() {
return (
<RadioButtons>
<RadioButton value='radio-button-1'>
<RadioIndicator /> Option 1
</RadioButton>
<RadioButton value='radio-button-2'>
<RadioIndicator /> Option 2
</RadioButton>
<RadioButton value='radio-button-3'>
<RadioIndicator />
Option 3
</RadioButton>
</RadioButtons>
)
}
Loading

0 comments on commit 3cfcd7b

Please sign in to comment.