Skip to content

Commit

Permalink
Merge pull request #336 from bounswe/feature/FE/316/home_page
Browse files Browse the repository at this point in the history
Home Page & Game Page
  • Loading branch information
elifkizilky authored Oct 29, 2023
2 parents d037e73 + 996ba71 commit 7ca921a
Show file tree
Hide file tree
Showing 12 changed files with 441 additions and 882 deletions.
37 changes: 29 additions & 8 deletions ludos/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed ludos/frontend/public/favicon.ico
Binary file not shown.
Binary file removed ludos/frontend/public/logo192.png
Binary file not shown.
Binary file removed ludos/frontend/public/logo512.png
Binary file not shown.
10 changes: 0 additions & 10 deletions ludos/frontend/public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
Expand Down
27 changes: 13 additions & 14 deletions ludos/frontend/src/App.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
import React from "react";
import { BrowserRouter as Router, Route, Routes } from "react-router-dom";
import HomePage from './pages/Homepage.js'
import GamePage from './pages/GamePage.js'
import React from 'react'
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
import './App.css';
import Layout from './layout.js'


import Layout from "./layout"; // Make sure to import your Layout component
import LandingPage from "./pages/landingPage"; // Import your LandingPage component
function App() {
return (
<Router>
<Routes>
<Route
path="/"
element={
<Layout>
<LandingPage />
</Layout>
}
/>
</Routes>
<div className="App">
<Routes>
<Route path="/home" element={<Layout><HomePage/></Layout>} />
<Route path="/game" element={<Layout><GamePage/></Layout>} />
</Routes>
</div>
</Router>
);
}
Expand Down
109 changes: 109 additions & 0 deletions ludos/frontend/src/components/Post.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import React, { useEffect } from "react";
import { Box, Typography, Button, Grid } from "@mui/material";
import { FaArrowUp, FaArrowDown } from "react-icons/fa";

function Post(data, key) {
const boxStyle = {
backgroundColor: "rgba(30, 30, 30, 0.9)",
borderRadius: "10px",
paddingTop: "15px",
};
const headerStyle = {
color: "white",
fontFamily: "Trebuchet MS, sans-serif",
marginBottom: "10px",
};
const forumStyle = { color: "rgb(0, 150, 255)" };
const followButton = {
backgroundColor: "rgb(255, 165, 0)",
color: "rgb(0, 0, 0)",
height: "20px",
textTransform: "none",
};
const descriptionStyle = { color: "white" };
const tagBox = {
display: "flex",
justifyContent: "center",
alignItems: "center",
backgroundColor: "rgb(0, 150, 255)",
color: "white",
height: "6px",
borderRadius: "10px",
padding: "5px",
marginRight: "5px",
};
const upVoteButton = {
backgroundColor: "rgb(124, 252, 0)",
marginRight: "5px",
};
const downVoteButton = { backgroundColor: "rgb(222, 49, 99)" };
useEffect(() => {}, []);

return (
<Grid item xs={12} sm={12} md={12} lg={12} key={key}>
<Box p={5} style={boxStyle}>
<Grid
item
xs={12}
sm={12}
md={12}
lg={12}
style={{ display: "flex", justifyContent: "space-between" }}
>
<Typography variant="caption" component="div" style={forumStyle}>
{data.post.forum}
</Typography>
<Grid style={{ display: "flex", justifyContent: "space-between" }}>
{data.post && data.post.tags.map((data1, index1) => (
<Typography
variant="caption"
component="div"
style={tagBox}
key={index1}
>
{data1}
</Typography>
))}
<Button variant="contained" style={followButton}>
Follow
</Button>
</Grid>
</Grid>

<Typography
variant="h4"
component="div"
textAlign="left"
style={headerStyle}
>
{data.post.header}
</Typography>
<Typography
variant="body2"
color="textSecondary"
textAlign="left"
style={descriptionStyle}
>
{data.post.description}
</Typography>
<Grid
style={{
display: "flex",
justifyContent: "flex-start",
alignItems: "center",
marginTop: "10px",
}}
>
<Button variant="contained" style={upVoteButton}>
<FaArrowUp style={{ color: "black" }} />
</Button>
<Button variant="contained" style={downVoteButton}>
<FaArrowDown />
</Button>
</Grid>
</Box>
</Grid>
);
}

export default Post;
1 change: 0 additions & 1 deletion ludos/frontend/src/logo.svg

This file was deleted.

Loading

0 comments on commit 7ca921a

Please sign in to comment.