-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: conflicts with master branch * feat: dev and staging gh actions * feat: done supporters page
- Loading branch information
1 parent
0d9053f
commit 8854303
Showing
11 changed files
with
146 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [develop] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: setup node js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.18.x | ||
|
||
- run: npm install | ||
|
||
- name: Create .env file | ||
run: | | ||
touch .env | ||
echo VITE_API_URL=${{ secrets.DEV_VITE_API_URL }} >> .env | ||
cat .env | ||
- run: npm run build | ||
|
||
- uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: sa-east-1 | ||
- run: aws s3 sync ./dist s3://dev.sos-rs.com |
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,34 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [staging] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: setup node js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.18.x | ||
|
||
- run: npm install | ||
|
||
- name: Create .env file | ||
run: | | ||
touch .env | ||
echo VITE_API_URL=${{ secrets.STG_VITE_API_URL }} >> .env | ||
cat .env | ||
- run: npm run build | ||
|
||
- uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: sa-east-1 | ||
- run: aws s3 sync ./dist s3://stg.sos-rs.com |
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
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,3 @@ | ||
import { useSupporters } from './useSupporters'; | ||
|
||
export { useSupporters }; |
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,8 @@ | ||
export interface ISupporter { | ||
id: string; | ||
name: string; | ||
imageUrl: string; | ||
link: string; | ||
createdAt: string; | ||
updatedAt?: string | null; | ||
} |
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,11 @@ | ||
import { useFetch } from '../useFetch'; | ||
import { ISupporter } from './types'; | ||
|
||
const useSupporters = () => { | ||
return useFetch<ISupporter[]>('/supporters', { | ||
initialValue: [], | ||
cache: true, | ||
}); | ||
}; | ||
|
||
export { useSupporters }; |
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,41 @@ | ||
import { BurgerMenu, Header, LoadingScreen } from '@/components'; | ||
import WithTooltip from '@/components/ui/with-tooltip'; | ||
import { useSupporters } from '@/hooks'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
const Supporters = () => { | ||
const { data: supporters, loading } = useSupporters(); | ||
|
||
if (loading) return <LoadingScreen />; | ||
|
||
return ( | ||
<div className="flex flex-col h-screen items-center bg-gray-50 overflow-auto"> | ||
<Header title="SOS Rio Grande do Sul" startAdornment={<BurgerMenu />} /> | ||
<div className="flex flex-col gap-4 p-4 max-w-5xl pb-8 w-full"> | ||
<h2 className="text-4xl pt-4 font-semibold !text-zinc-900"> | ||
Apoiadores do projeto | ||
</h2> | ||
<div className="grid grid-cols-2 md:grid-cols-4 w-full gap-4 md:gap-8 mt-8"> | ||
{supporters | ||
.sort((a, b) => a.createdAt.localeCompare(b.createdAt)) | ||
.map((supporter, idx) => ( | ||
<Link key={idx} to={supporter.link}> | ||
<WithTooltip content={supporter.name}> | ||
<div className="bg-white flex flex-col gap-2 w-full aspect-square p-4 justify-between shadow-sm rounded-md hover:border-text hover:cursor-pointer"> | ||
<div | ||
style={{ | ||
backgroundImage: `url('${supporter.imageUrl}')`, | ||
}} | ||
className="flex-1 bg-center w-full bg-contain bg-no-repeat" | ||
/> | ||
</div> | ||
</WithTooltip> | ||
</Link> | ||
))} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export { Supporters }; |
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,3 @@ | ||
import { Supporters } from './Supporters'; | ||
|
||
export { Supporters }; |
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