Skip to content

Commit 33fe7b5

Browse files
Merge branch 'master' into show_club
2 parents bb7160b + d1be284 commit 33fe7b5

File tree

12 files changed

+559
-137
lines changed

12 files changed

+559
-137
lines changed
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
const Joi = require("@hapi/joi");
2-
const { id } = require("./user");
1+
const Joi = require('@hapi/joi');
2+
const { id } = require('./user');
33

44
const ClubSchema = Joi.object({
5-
id: id,
5+
id: id,
66

7-
name: Joi.string().required(),
7+
name: Joi.string().required(),
88

9-
description: Joi.string().required(),
9+
description: Joi.string().required(),
1010

11-
officers: Joi.array()
12-
.items(id)
13-
.min(1),
11+
officers: Joi.array()
12+
.items(id)
13+
.min(1),
1414

15-
meetingTime: Joi.object({
16-
day: Joi.string(),
17-
time: Joi.string(),
18-
period: Joi.string()
19-
}),
15+
meetingTime: Joi.object({
16+
day: Joi.string(),
17+
time: Joi.string(),
18+
period: Joi.string()
19+
}),
2020

21-
gallery: Joi.array().items(Joi.string()),
21+
gallery: Joi.array().items(Joi.string()),
2222

23-
avatarUrl: Joi.string(),
23+
avatarUrl: Joi.string(),
2424

25-
bannerUrl: Joi.string(),
25+
bannerUrl: Joi.string(),
2626

27-
active: Joi.boolean().required(),
27+
active: Joi.boolean().required(),
2828

29-
//stores array of user ids that favorite club
30-
favoriteUsers: Joi.array().items(id),
29+
//stores array of user ids that favorite club
30+
favoriteUsers: Joi.array().items(id),
3131

32-
tags: Joi.array().items(Joi.string())
32+
tags: Joi.array().items(Joi.string())
3333
});
3434

3535
module.exports = ClubSchema;

packages/backend/express/bin/www

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,84 +4,84 @@
44
* Module dependencies.
55
*/
66

7-
const app = require('../app')
8-
const debug = require('debug')('express:server')
9-
const http = require('http')
7+
const app = require('../app');
8+
const debug = require('debug')('express:server');
9+
const http = require('http');
1010

1111
/**
1212
* Get port from environment and store in Express.
1313
*/
1414

15-
const port = normalizePort(process.env.PORT || '3000')
16-
app.set('port', port)
17-
console.log(`Your express app is running on http://localhost:${port}`)
15+
const port = normalizePort(process.env.PORT || '3001');
16+
app.set('port', port);
17+
console.log(`Your express app is running on http://localhost:${port}`);
1818

1919
/**
2020
* Create HTTP server.
2121
*/
2222

23-
const server = http.createServer(app)
23+
const server = http.createServer(app);
2424

2525
/**
2626
* Listen on provided port, on all network interfaces.
2727
*/
2828

29-
server.listen(port)
30-
server.on('error', onError)
31-
server.on('listening', onListening)
29+
server.listen(port);
30+
server.on('error', onError);
31+
server.on('listening', onListening);
3232

3333
/**
3434
* Normalize a port into a number, string, or false.
3535
*/
3636

3737
function normalizePort(val) {
38-
const port = parseInt(val, 10)
38+
const port = parseInt(val, 10);
3939

40-
if (isNaN(port)) {
41-
// named pipe
42-
return val
43-
}
40+
if (isNaN(port)) {
41+
// named pipe
42+
return val;
43+
}
4444

45-
if (port >= 0) {
46-
// port number
47-
return port
48-
}
45+
if (port >= 0) {
46+
// port number
47+
return port;
48+
}
4949

50-
return false
50+
return false;
5151
}
5252

5353
/**
5454
* Event listener for HTTP server "error" event.
5555
*/
5656

5757
function onError(error) {
58-
if (error.syscall !== 'listen') {
59-
throw error
60-
}
61-
62-
const bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port
63-
64-
// handle specific listen errors with friendly messages
65-
switch (error.code) {
66-
case 'EACCES':
67-
console.error(bind + ' requires elevated privileges')
68-
process.exit(1)
69-
break
70-
case 'EADDRINUSE':
71-
console.error(bind + ' is already in use')
72-
process.exit(1)
73-
break
74-
default:
75-
throw error
76-
}
58+
if (error.syscall !== 'listen') {
59+
throw error;
60+
}
61+
62+
const bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port;
63+
64+
// handle specific listen errors with friendly messages
65+
switch (error.code) {
66+
case 'EACCES':
67+
console.error(bind + ' requires elevated privileges');
68+
process.exit(1);
69+
break;
70+
case 'EADDRINUSE':
71+
console.error(bind + ' is already in use');
72+
process.exit(1);
73+
break;
74+
default:
75+
throw error;
76+
}
7777
}
7878

7979
/**
8080
* Event listener for HTTP server "listening" event.
8181
*/
8282

8383
function onListening() {
84-
const addr = server.address()
85-
const bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port
86-
debug('Listening on ' + bind)
84+
const addr = server.address();
85+
const bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;
86+
debug('Listening on ' + bind);
8787
}

packages/frontend/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"private": true,
55
"dependencies": {
66
"@clubhub/common": "0.1.0",
7+
"@material-ui/core": "^4.7.1",
8+
"@material-ui/icons": "^4.5.1",
79
"axios": "^0.19.0",
810
"react": "^16.9.0",
911
"react-dom": "^16.9.0",
Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
1-
import React from 'react'
2-
import styles from './AppBar.module.css'
3-
import { Link } from 'react-router-dom'
4-
import { SearchBar } from '@clubhub/components'
5-
1+
import React from 'react';
2+
import styles from './AppBar.module.css';
3+
import { Link } from 'react-router-dom';
64

75
const AppBar = () => {
8-
return (
9-
<div className={styles.root}>
10-
<SearchBar/>
11-
<div>
12-
<ul>
13-
<li>
14-
<Link to="/">Home</Link>
15-
</li>
16-
<li>
17-
<Link to="/login">Login</Link>
18-
</li>
19-
<li>
20-
<Link to="/register">Register</Link>
21-
</li>
22-
<li>
23-
<Link to="/setting">Setting</Link>
24-
</li>
25-
</ul>
26-
</div>
27-
</div>
28-
)
29-
}
6+
return (
7+
<div className={styles.root}>
8+
<div>
9+
<ul>
10+
<li>
11+
<Link to='/'>Home</Link>
12+
</li>
13+
<li>
14+
<Link to='/login'>Login</Link>
15+
</li>
16+
<li>
17+
<Link to='/register'>Register</Link>
18+
</li>
19+
<li>
20+
<Link to='/setting'>Setting</Link>
21+
</li>
22+
</ul>
23+
</div>
24+
</div>
25+
);
26+
};
3027

31-
export default AppBar
28+
export default AppBar;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.root {
2-
display: flex;
3-
flex-direction: row;
1+
ul {
2+
display: flex;
3+
flex-direction: row;
44
}
Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
import React from 'react'
2-
import styles from './SearchBar.module.css'
1+
import React from 'react';
2+
import styles from './SearchBar.module.css';
33

4-
const SearchBar = () => {
5-
return (
6-
<input type="search" placeholder="Search..." className={styles.SearchBar}/>
7-
)}
4+
const SearchBar = ({ onChange }) => {
5+
return (
6+
<input
7+
type='search'
8+
placeholder='Search...'
9+
className={styles.SearchBar}
10+
onChange={onChange}
11+
/>
12+
);
13+
};
814

9-
export default SearchBar
15+
export default SearchBar;
Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
21
.SearchBar {
3-
border: 1px solid white;
4-
display: block;
5-
float: right;
6-
width: 285px;
7-
height: 30px;
8-
padding-left: 15px;
9-
padding-right: 15px;
10-
border-radius: 15px;
11-
background-image: url("search_icon.png");
12-
background-repeat: no-repeat;
13-
background-position: 97% 50%;
2+
border: 1px solid white;
3+
display: block;
4+
float: right;
5+
width: 80%;
6+
height: 50px;
7+
padding-left: 15px;
8+
padding-right: 15px;
9+
border-radius: 15px;
10+
background-image: url('search_icon.png');
11+
background-repeat: no-repeat;
12+
background-position: 97% 50%;
1413

15-
background-size: 16px;
14+
background-size: 16px;
1615
}
1716

18-
.SearchBar:focus{
19-
outline: none;
20-
}
17+
.SearchBar:focus {
18+
outline: none;
19+
}

packages/frontend/src/pages/ClubPage/ClubPage.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
import React, { useState, useEffect } from "react";
23
import styles from "./ClubPage.module.css";
34
//import { clubEndpoint, clubID } from "../../apis/endpoints";
@@ -24,4 +25,5 @@ const ClubPage = props => {
2425
return <div className={styles.root}>ClubPage</div>; //JSON.stringify(club) // {club.name}...
2526
};
2627

28+
2729
export default ClubPage;

0 commit comments

Comments
 (0)