-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4331f6f
commit 9ad6510
Showing
14 changed files
with
631 additions
and
583 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
name: Deploy to GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- deploy # branch to deploy from. Force redeploy | ||
push: | ||
branches: | ||
- deploy # branch to deploy from. Force redeploy | ||
|
||
jobs: | ||
build: | ||
environment: github-pages | ||
runs-on: ubuntu-latest | ||
build: | ||
environment: github-pages | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '18' | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build the project | ||
env: | ||
VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }} | ||
VITE_SUPABASE_ANON_KEY: ${{ secrets.VITE_SUPABASE_ANON_KEY }} | ||
run: npm run build | ||
- name: Build the project | ||
env: | ||
VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }} | ||
VITE_SUPABASE_ANON_KEY: ${{ secrets.VITE_SUPABASE_ANON_KEY }} | ||
run: npm run build | ||
|
||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./dist | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"trailingComma": "es5", | ||
"tabWidth": 4, | ||
"singleQuote": true, | ||
"semi": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import type { StorybookConfig } from '@storybook/react-vite'; | ||
|
||
const config: StorybookConfig = { | ||
// stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"], | ||
stories: ['../src/components/**/*.stories.@(ts|tsx)'], | ||
addons: [ | ||
'@storybook/addon-onboarding', | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@chromatic-com/storybook', | ||
'@storybook/addon-interactions', | ||
], | ||
framework: { | ||
name: '@storybook/react-vite', | ||
options: {}, | ||
}, | ||
// stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"], | ||
stories: ['../src/components/**/*.stories.@(ts|tsx)'], | ||
addons: [ | ||
'@storybook/addon-onboarding', | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@chromatic-com/storybook', | ||
'@storybook/addon-interactions', | ||
], | ||
framework: { | ||
name: '@storybook/react-vite', | ||
options: {}, | ||
}, | ||
}; | ||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,48 @@ | ||
import { BrowserRouter } from 'react-router-dom' | ||
import { useEffect } from 'react' | ||
import AppRoutes from './routes/AppRoutes' | ||
import { Footer } from '@/components/Footer/Footer' | ||
import NavBar from './components/NavBar/NavBar' | ||
import { supabase } from './lib/supabaseClient' | ||
import { AuthChangeEvent, Session } from '@supabase/supabase-js' | ||
import { BrowserRouter } from 'react-router-dom'; | ||
import { useEffect } from 'react'; | ||
import AppRoutes from './routes/AppRoutes'; | ||
import { Footer } from '@/components/Footer/Footer'; | ||
import NavBar from './components/NavBar/NavBar'; | ||
import { supabase } from './lib/supabaseClient'; | ||
import { AuthChangeEvent, Session } from '@supabase/supabase-js'; | ||
import { AuthProvider } from './AuthContext'; | ||
|
||
function App() { | ||
useEffect(() => { | ||
const { data: authListener } = supabase.auth.onAuthStateChange( | ||
(event: AuthChangeEvent, session: Session | null) => { | ||
if (event === 'SIGNED_IN') { | ||
// Handle sign in | ||
console.log('User signed in:', session?.user) | ||
// You might want to update your app state or context here | ||
} else if (event === 'SIGNED_OUT') { | ||
// Handle sign out | ||
console.log('User signed out') | ||
// You might want to clear user data from your app state or context here | ||
} | ||
} | ||
) | ||
useEffect(() => { | ||
const { data: authListener } = supabase.auth.onAuthStateChange( | ||
(event: AuthChangeEvent, session: Session | null) => { | ||
if (event === 'SIGNED_IN') { | ||
// Handle sign in | ||
console.log('User signed in:', session?.user); | ||
// You might want to update your app state or context here | ||
} else if (event === 'SIGNED_OUT') { | ||
// Handle sign out | ||
console.log('User signed out'); | ||
// You might want to clear user data from your app state or context here | ||
} | ||
} | ||
); | ||
|
||
return () => { | ||
authListener.subscription.unsubscribe() | ||
} | ||
}, []) | ||
return () => { | ||
authListener.subscription.unsubscribe(); | ||
}; | ||
}, []); | ||
|
||
return ( | ||
<> | ||
<AuthProvider> | ||
{' '} | ||
{/* Wrap the entire app with AuthProvider */} | ||
<BrowserRouter> | ||
<div className='grid min-h-[100dvh] grid-rows-[auto_1fr_auto]'> | ||
<NavBar /> | ||
<AppRoutes /> | ||
<Footer></Footer> | ||
</div> | ||
</BrowserRouter> | ||
</AuthProvider> | ||
</> | ||
) | ||
return ( | ||
<> | ||
<AuthProvider> | ||
{' '} | ||
{/* Wrap the entire app with AuthProvider */} | ||
<BrowserRouter> | ||
<div className="grid min-h-[100dvh] grid-rows-[auto_1fr_auto]"> | ||
<NavBar /> | ||
<AppRoutes /> | ||
<Footer></Footer> | ||
</div> | ||
</BrowserRouter> | ||
</AuthProvider> | ||
</> | ||
); | ||
} | ||
|
||
export default App | ||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,46 @@ | ||
export interface ButtonProps { | ||
/** | ||
* Is this the principal call to action on the page? | ||
*/ | ||
primary?: boolean; | ||
/** | ||
* What background color to use | ||
*/ | ||
backgroundColor?: string; | ||
/** | ||
* Is this the principal call to action on the page? | ||
*/ | ||
primary?: boolean; | ||
/** | ||
* What background color to use | ||
*/ | ||
backgroundColor?: string; | ||
|
||
fontFamily?:string; | ||
/** | ||
* How large should the button be? | ||
*/ | ||
size?: 'small' | 'medium' | 'large'; | ||
/** | ||
* Button contents | ||
*/ | ||
label: string; | ||
/** | ||
* Optional click handler | ||
*/ | ||
onClick?: () => void; | ||
fontFamily?: string; | ||
/** | ||
* How large should the button be? | ||
*/ | ||
size?: 'small' | 'medium' | 'large'; | ||
/** | ||
* Button contents | ||
*/ | ||
label: string; | ||
/** | ||
* Optional click handler | ||
*/ | ||
onClick?: () => void; | ||
} | ||
|
||
export const Button = ({ | ||
primary = true, | ||
size = 'medium', | ||
backgroundColor, | ||
fontFamily, | ||
label, | ||
...props | ||
primary = true, | ||
size = 'medium', | ||
backgroundColor, | ||
fontFamily, | ||
label, | ||
...props | ||
}: ButtonProps) => { | ||
return ( | ||
<button | ||
type='button' | ||
className={['storybook-button', `storybook-button--${size}`].join(' ')} | ||
style={{ backgroundColor, fontFamily }} | ||
{...props} | ||
> | ||
{label} | ||
</button> | ||
); | ||
return ( | ||
<button | ||
type="button" | ||
className={['storybook-button', `storybook-button--${size}`].join( | ||
' ' | ||
)} | ||
style={{ backgroundColor, fontFamily }} | ||
{...props} | ||
> | ||
{label} | ||
</button> | ||
); | ||
}; |
Oops, something went wrong.