Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 22 additions & 20 deletions client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,28 @@ function App() {
}, [])

return (
<UserContext.Provider value={{user, setUser}}>
<MuiThemeProvider theme={theme}>
<Router>
<NavBar />
<Switch>
<Route path='/signup' component={Signup}></Route>
<Route path='/login' component={Login}></Route>
<Route path='/profile/:id' component={ProfilePage}></Route>
<Route path='/contest-details/:id' component={ContestDetails}></Route>
<Route path='/create-contest' component={CreateContestPage}></Route>
<Route path='/submit-design/:id' component={SubmitDesignPage}></Route>
<Route path='/message' component={SocketPage}></Route>
<Route path="/add-card" component={PaymentInfo}></Route>
<Route path="/edit-profile" component={EditProfilePage} />
<Route path='/message/' component={SocketPage}></Route>
<Route path='/' component={DiscoveryPage} />
</Switch>
</Router>
</MuiThemeProvider>
</UserContext.Provider>
<MuiThemeProvider theme={theme}>
<UserContext.Provider value={{user, setUser}}>
<MuiThemeProvider theme={theme}>
<Router>
<NavBar />
<Switch>
<Route path='/signup' component={Signup}></Route>
<Route path='/login' component={Login}></Route>
<Route path='/profile/:id' component={ProfilePage}></Route>
<Route path='/contest-details/:id' component={ContestDetails}></Route>
<Route path='/create-contest' component={CreateContestPage}></Route>
<Route path='/submit-design/:id' component={SubmitDesignPage}></Route>
<Route path='/message' component={SocketPage}></Route>
<Route path="/add-card" component={PaymentInfo}></Route>
<Route path="/edit-profile" component={EditProfilePage} />
<Route path='/message/' component={SocketPage}></Route>
<Route path='/' component={DiscoveryPage} />
</Switch>
</Router>
</MuiThemeProvider>
</UserContext.Provider>
</MuiThemeProvider>
)
}

Expand Down
8 changes: 7 additions & 1 deletion client/src/components/ContestCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,20 @@ const useStyles = makeStyles((theme) => ({
backgroundImage: 'linear-gradient(to top,rgba(0,0,0,.7) 10%,rgba(0,0,0,0))'
},
info: {
padding: '2rem 4rem'
leftMargin: "300px",
padding: '2rem 4rem',
width: "1100px",
height: "200px"
},
title: {
fontSize: '1.4rem',
fontWeight: 'bold'
},
description: {
height: "70%",
fontSize: '1rem',
overflow: "hidden",
textOverflow: "ellipsis"
},
prizeAmount: {
width: '8rem',
Expand Down
6 changes: 6 additions & 0 deletions client/src/components/CreditCardForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ const useStyles = makeStyles(theme => ({
},
button: {
marginTop: theme.spacing(5)
},
input: {
width: "300px"
}
}));

Expand Down Expand Up @@ -112,6 +115,7 @@ function CreditCardForm() {
<CardNumberElement
onChange={onChangeNumber}
options={CARD_ELEMENT_OPTIONS}
className={classes.input}
/>
</label>
</div>
Expand All @@ -122,6 +126,7 @@ function CreditCardForm() {
<CardExpiryElement
onChange={onChangeExpiry}
options={CARD_ELEMENT_OPTIONS}
className={classes.input}
/>
</label>
</div>
Expand All @@ -132,6 +137,7 @@ function CreditCardForm() {
<CardCvcElement
onChange={onChangeCVC}
options={CARD_ELEMENT_OPTIONS}
className={classes.input}
/>
</label>
</div>
Expand Down
12 changes: 7 additions & 5 deletions client/src/pages/ContestDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const useStyles = makeStyles((theme) => ({
maringBottom: '0.5rem'
},
prizeAmount: {
width: '4rem',
width: '8rem',
textAlign: 'center',
padding: '0.5rem',
marginLeft: '0.5rem',
Expand All @@ -70,9 +70,9 @@ const useStyles = makeStyles((theme) => ({
marginTop: '0.5rem',
display: 'flex',
flexDirection: 'row',
'& .MuiTypography-h5': {
'& span': {
alignSelf: 'center',
marginLeft: '1rem'
marginLeft: '1rem',
}
},
avatar: {
Expand Down Expand Up @@ -159,6 +159,7 @@ export default function ContestDetails(props) {
setWinningSubmission(parseInt(e.target.value))
}


const onWinnerSubmit = e => {
setContestWinner(contestId, winningSubmission, data => {
console.log('Winner Successfully Declared')
Expand Down Expand Up @@ -241,7 +242,8 @@ export default function ContestDetails(props) {
}/>
</GridListTile>
))
if (Date.parse(contest.deadline_date) < Date.now() && contest.winner == null) {

if (contest.winner === null) {
createSubmitWinnerButton()
}
} else {
Expand Down Expand Up @@ -324,7 +326,7 @@ export default function ContestDetails(props) {
</div>
<div className={classes.author}>
<img src={user.icon} onClick={onProfileClick} alt='designer avatar' className={classes.avatar} />
<Typography onClick={onProfileClick} variant='h5'>{contest.creater_name}</Typography>
<Typography onClick={onProfileClick} variant='h7'>{contest.creater_name}</Typography>
</div>
</Grid>
<Grid item xs={5} className={classes.submitButtonDiv}>
Expand Down
10 changes: 9 additions & 1 deletion client/src/pages/EditProfilePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Button, InputLabel, OutlinedInput} from '@material-ui/core'
import { makeStyles } from "@material-ui/core/styles"
import { getProfile, editProfile } from "../apiCalls"
import { UserContext } from '../App'
import { useHistory } from 'react-router-dom'


const useStyles = makeStyles(theme => ({
Expand Down Expand Up @@ -36,10 +37,16 @@ const useStyles = makeStyles(theme => ({

upload: {
position: "relative",
marginBottom: "5px",
top: "5%",
left: "25%",
},

addCard: {
top: "7%",
left: "18%"
},

submit: {
position: "relative",
top: "5%",
Expand Down Expand Up @@ -87,6 +94,7 @@ const EditProfilePage = () => {
const [iconURL, setIconURL] = useState(user.icon)
const [imageFile, setImageFile] = useState(null)
const hiddenFileInput = useRef(null);
const history = useHistory();

useEffect(() => {
setUsername(user.username)
Expand Down Expand Up @@ -147,7 +155,7 @@ const EditProfilePage = () => {

<input type="file" ref={hiddenFileInput} style={{display:'none'}} onChange={handleFileChange} accept="image/*"/>
<Button className={classes.upload} variant="outlined" onClick={uploadFile} >Upload</Button>

<Button className={classes.addCard} variant="outlined" onClick={() => history.push("/add-card")} >Add Card</Button>
</div>

<div className={classes.floatDiv}>
Expand Down