Skip to content

Commit

Permalink
Redeploy
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVOiceover committed Aug 6, 2024
1 parent 4331f6f commit 9ad6510
Show file tree
Hide file tree
Showing 14 changed files with 631 additions and 583 deletions.
50 changes: 25 additions & 25 deletions .github/workflows/deploy.yml
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
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"singleQuote": true,
"semi": true
}
26 changes: 13 additions & 13 deletions .storybook/main.ts
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;
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ NISA Invest is a personal finance platform for Muslim women.

This project uses the following technologies:

- **Frontend Framework**: React
- **Language**: TypeScript
- **Build Tool**: Vite
- **UI Styling**: Tailwind CSS
- **Frontend Framework**: React
- **Language**: TypeScript
- **Build Tool**: Vite
- **UI Styling**: Tailwind CSS

## Getting Started

Expand Down Expand Up @@ -40,11 +40,14 @@ npm install

and include the following line:

- development:
- development:

```env
VITE_BASE_URL = "https://nisa-invest-tfb-be.vercel.app"
```
- production:

- production:

```env
VITE_BASE_URL = "https://nisa-invest-tfb-be.vercel.app"
```
Expand All @@ -63,4 +66,4 @@ Contributors should refer to our style guide for coding conventions and best pra

Please make sure to read and follow the style guide before submitting any pull requests.

#Force redeploy
#Force redeploy
82 changes: 41 additions & 41 deletions src/App.tsx
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;
76 changes: 39 additions & 37 deletions src/components/Button/Button.tsx
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>
);
};
Loading

0 comments on commit 9ad6510

Please sign in to comment.