Skip to content

Commit b2742c4

Browse files
committed
links
1 parent e4708b4 commit b2742c4

File tree

8 files changed

+206
-12
lines changed

8 files changed

+206
-12
lines changed

.github/workflows/deploy.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Deploy React App to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
# Build job
26+
build:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Setup Node.js
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: '20'
36+
cache: 'npm'
37+
38+
- name: Install dependencies
39+
run: npm install
40+
41+
- name: Build Site
42+
run: npm run build
43+
env:
44+
CI: false
45+
PUBLIC_URL: /
46+
47+
- name: Setup Pages
48+
uses: actions/configure-pages@v4
49+
50+
- name: Upload artifact
51+
uses: actions/upload-pages-artifact@v3
52+
with:
53+
path: ./build
54+
55+
# Deployment job
56+
deploy:
57+
environment:
58+
name: github-pages
59+
url: ${{ steps.deployment.outputs.page_url }}
60+
runs-on: ubuntu-latest
61+
needs: build
62+
# Only deploy on pushes to main branch (not on PRs)
63+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
64+
steps:
65+
- name: Deploy to GitHub Pages
66+
id: deployment
67+
uses: actions/deploy-pages@v4

package-lock.json

Lines changed: 59 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
},
1212
"dependencies": {
1313
"react": "^19.2.0",
14-
"react-dom": "^19.2.0"
14+
"react-dom": "^19.2.0",
15+
"react-router-dom": "^7.12.0"
1516
},
1617
"devDependencies": {
1718
"@eslint/js": "^9.39.1",

src/App.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,30 @@
1717
height: 200px;
1818
}
1919

20+
.page-container {
21+
flex: 1;
22+
display: flex;
23+
flex-direction: column;
24+
align-items: center;
25+
justify-content: center;
26+
padding: 2rem;
27+
text-align: center;
28+
}
29+
30+
.page-container h1 {
31+
margin-bottom: 1rem;
32+
}
33+
34+
.page-container a {
35+
margin-top: 2rem;
36+
color: inherit;
37+
opacity: 0.7;
38+
}
39+
40+
.page-container a:hover {
41+
opacity: 1;
42+
}
43+
2044
.footer {
2145
display: flex;
2246
justify-content: center;

src/App.tsx

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1-
import logo from './assets/logo.png'
1+
import { BrowserRouter, Routes, Route, Link } from 'react-router-dom'
2+
import Home from './pages/Home'
3+
import Privacy from './pages/Privacy'
4+
import Terms from './pages/Terms'
25
import './App.css'
36

47
function App() {
58
return (
6-
<div className="app-container">
7-
<main className="main-content">
8-
<img src={logo} className="logo" alt="Logo" />
9-
</main>
10-
<footer className="footer">
11-
<a href="/privacy">Privacy Policy</a>
12-
<a href="/terms">Terms</a>
13-
</footer>
14-
</div>
9+
<BrowserRouter>
10+
<div className="app-container">
11+
<Routes>
12+
<Route path="/" element={<Home />} />
13+
<Route path="/privacy" element={<Privacy />} />
14+
<Route path="/terms" element={<Terms />} />
15+
</Routes>
16+
<footer className="footer">
17+
<Link to="/privacy">Privacy Policy</Link>
18+
<Link to="/terms">Terms</Link>
19+
</footer>
20+
</div>
21+
</BrowserRouter>
1522
)
1623
}
1724

src/pages/Home.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import logo from '../assets/logo.png'
2+
3+
function Home() {
4+
return (
5+
<main className="main-content">
6+
<img src={logo} className="logo" alt="Logo" />
7+
</main>
8+
)
9+
}
10+
11+
export default Home

src/pages/Privacy.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Link } from 'react-router-dom'
2+
3+
function Privacy() {
4+
return (
5+
<div className="page-container">
6+
<h1>Privacy Policy</h1>
7+
<p>Privacy policy content coming soon.</p>
8+
<Link to="/">← Back to Home</Link>
9+
</div>
10+
)
11+
}
12+
13+
export default Privacy

src/pages/Terms.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Link } from 'react-router-dom'
2+
3+
function Terms() {
4+
return (
5+
<div className="page-container">
6+
<h1>Terms of Service</h1>
7+
<p>Terms of service content coming soon.</p>
8+
<Link to="/">← Back to Home</Link>
9+
</div>
10+
)
11+
}
12+
13+
export default Terms

0 commit comments

Comments
 (0)