This repository has been archived by the owner on Nov 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Notification replaced by Profile. * Updated text of profile page. * Login actions added.
- Loading branch information
1 parent
4c1b0a1
commit ff1e047
Showing
24 changed files
with
322 additions
and
192 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,29 +1,16 @@ | ||
import React from 'react' | ||
import Top_ from './top.sc' | ||
import Input_ from './input.sc' | ||
import Label_ from './label.sc' | ||
import * as R from 'ramda' | ||
|
||
const Input = ({state: [state, setState] = [{}], children: name, type = 'text', ...rest}) => { | ||
const onChange = event => { | ||
const newState = R.merge( | ||
state, | ||
{[name]: event.target.value} | ||
) | ||
setState(newState) | ||
} | ||
import React from 'react' | ||
import Top_ from './top.sc' | ||
|
||
return ( | ||
<Top_ {...rest}> | ||
<Label_>{name}</Label_> | ||
<Input_ | ||
placeholder={name} | ||
type={type} | ||
value={state[name]} | ||
onChange={onChange} | ||
/> | ||
</Top_> | ||
) | ||
} | ||
const Input = ({label, ...props}, ref) => ( | ||
<Top_> | ||
<Label_>{label}</Label_> | ||
<Input_ | ||
ref={ref} | ||
{...props} | ||
/> | ||
</Top_> | ||
) | ||
|
||
export default Input | ||
export default React.forwardRef(Input) |
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 |
---|---|---|
@@ -1,25 +1,34 @@ | ||
import * as R from 'ramda' | ||
import Top_ from './top.sc' | ||
import Link_ from './link.sc' | ||
import React from 'react' | ||
import {withRouter} from 'react-router-dom' | ||
|
||
const NavMenu = ({isAuthenticated, history: {location: {pathname: path}}, ...rest}) => { | ||
const logIn = path === '/log-in' | ||
return ( | ||
<Top_ {...rest}> | ||
<Link_ to="/review">Review</Link_> | ||
<Link_ to="/search">Search</Link_> | ||
<Link_ to="/notifications" hidden={!isAuthenticated}> | ||
Notifications | ||
</Link_> | ||
<Link_ to="/sign-up" hidden={isAuthenticated || logIn}> | ||
Sign up | ||
</Link_> | ||
<Link_ to='/log-in' hidden={isAuthenticated || !logIn}> | ||
Log in | ||
</Link_> | ||
</Top_> | ||
) | ||
} | ||
const isLogin = R.pathEq([ | ||
`history`, `location`, `pathname` | ||
], `/login`) | ||
|
||
const NavMenu = ({isAuthenticated, ...props}) => ( | ||
<Top_ {...props}> | ||
<Link_ to="/review"> | ||
Review | ||
</Link_> | ||
<Link_ to="/search"> | ||
Search | ||
</Link_> | ||
<Link_ to="/notifications" hidden={true}> | ||
Notifications | ||
</Link_> | ||
<Link_ to="/profile" hidden={!isAuthenticated}> | ||
Profile | ||
</Link_> | ||
<Link_ to="/sign-up" hidden={isAuthenticated || isLogin(props)}> | ||
Sign up | ||
</Link_> | ||
<Link_ to='/login' hidden={isAuthenticated || !isLogin(props)}> | ||
Log in | ||
</Link_> | ||
</Top_> | ||
) | ||
|
||
export default withRouter(NavMenu) |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.