Skip to content

Commit

Permalink
Add RoomSettingButton
Browse files Browse the repository at this point in the history
  • Loading branch information
GBS-Skile committed Jun 19, 2019
1 parent ee9f494 commit b78f5a5
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 4 deletions.
Binary file added frontend/public/settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions frontend/src/components/atoms/Graph/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const Wrapper = styled.div`
padding-top: 100%;
width: 100%;
position: relative;
z-index: -1;
`

const Content = styled.div`
Expand Down
26 changes: 26 additions & 0 deletions frontend/src/components/atoms/LinkButton/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react'
import PropTypes from 'prop-types'
import { withRouter } from 'react-router-dom'

import { Button } from 'components'

const LinkButton = props => {
const { onClick, history, to, ...rest } = props
return (
<Button
{...rest}
onClick={
evt => {
onClick && onClick(evt)
history.push(to)
}
}
/>
)
}

LinkButton.propTypes = {
to: PropTypes.string.isRequired
}

export default withRouter(LinkButton)
19 changes: 15 additions & 4 deletions frontend/src/components/pages/RoomPage/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
import React from 'react'
import styled from 'styled-components'
import PropTypes from 'prop-types'

import { Block, Button, Graph, List, ListItem, Header } from 'components'
import { Block, Button, Graph, List, LinkButton, ListItem, Header } from 'components'
import { MemberList, PaymentList } from 'containers'
import { getMemberDebtList, getSimplifiedGraph } from 'services/simplifier'
import { Link } from 'react-router-dom'

const SettingButton = styled(LinkButton)`
align-self: flex-end;
background: url('/settings.png');
border: 0;
outline: 0;
margin: -32px 0 0;
padding: 0;
height: 32px;
width: 32px;
cursor: pointer;
`

const RoomPage = props => {
const { room, members, showPayment, payments, onClickMember, onToggle } = props
if (!room) return <Block transparent>Loading...</Block>
Expand Down Expand Up @@ -37,6 +50,7 @@ const RoomPage = props => {
<Header />
<Block transparent>
<Graph graph={graph} events={events} />
<SettingButton to={`/room/${room.url}/setting/`} />
</Block>
<Button onClick={onToggle}>
{showPayment ? "멤버 목록 보기" : "결제 목록 보기"}
Expand All @@ -48,9 +62,6 @@ const RoomPage = props => {
<Block transparent>
<a>로그아웃</a>
</Block>
<Block>
<Link to={`/room/${room.url}/setting/`}>button</Link>
</Block>
</div>
)
}
Expand Down

0 comments on commit b78f5a5

Please sign in to comment.