diff --git a/webclient/src/components/Header/Header.css b/webclient/src/components/Header/Header.css index 0a27efd6..ead7f73e 100644 --- a/webclient/src/components/Header/Header.css +++ b/webclient/src/components/Header/Header.css @@ -38,11 +38,74 @@ .Header-nav { width: 100%; display: flex; - justify-content: flex-end; + justify-content: space-between; } -.Header-nav__menu { - margin-left: 10px; +.Header-nav__links { + width: 100%; + display: flex; + padding-left: 50px; + align-items: center; +} + +.Header-nav__link { + position: relative; + height: 100%; +} + +.Header-nav__link:hover { + background: rgba(0, 0, 0, .125); +} + +.Header-nav__link:hover .Header-nav__link-menu { + display: block; +} + +.Header-nav__link-btn { + display: flex; + height: 100%; + width: 100%; + align-items: center; + padding: 5px 10px; + font-weight: bold; +} + +.Header-nav__link-btn__icon { + margin-left: 5px; +} + +.Header-nav__link-menu { + display: none; + position: absolute; + bottom: 0; + transform: translateY(100%); + min-width: 150px; + background: #3f51b5; + box-shadow: 1px 1px 2px 0px black; +} + +.Header-nav__link-menu__item { + padding: 0 !important; +} + +.Header-nav__link-menu__btn { + padding: 6px 16px; + width: 100%; + color: white; + display: flex; + justify-content: space-between; +} + +.Header-nav__actions { + display: flex; +} + +.Header-nav__action { + +} + +.Header-nav__action button { + color: white; } .temp-subnav__rooms { diff --git a/webclient/src/components/Header/Header.tsx b/webclient/src/components/Header/Header.tsx index 3e9dc85e..4302184b 100644 --- a/webclient/src/components/Header/Header.tsx +++ b/webclient/src/components/Header/Header.tsx @@ -2,11 +2,13 @@ import React, { Component } from "react"; import { connect } from "react-redux"; import { NavLink, withRouter, generatePath } from "react-router-dom"; import AppBar from "@material-ui/core/AppBar"; -import Chip from "@material-ui/core/Chip"; import IconButton from "@material-ui/core/IconButton"; import Menu from "@material-ui/core/Menu"; import MenuItem from "@material-ui/core/MenuItem"; import Toolbar from "@material-ui/core/Toolbar"; +import ArrowDropDownIcon from '@material-ui/icons/ArrowDropDown'; +import CloseIcon from '@material-ui/icons/Close'; +import MailOutlineRoundedIcon from '@material-ui/icons/MailOutline'; import MenuRoundedIcon from '@material-ui/icons/MenuRounded'; import * as _ from "lodash"; @@ -21,20 +23,18 @@ class Header extends Component { state: HeaderState; options: string[] = [ 'Account', - 'Decks', 'Replays', ]; constructor(props) { super(props); - this.state = { - anchorEl: null, - }; + this.state = { anchorEl: null }; - this.handleMenuClick = this.handleMenuClick.bind(this); + this.handleMenuOpen = this.handleMenuOpen.bind(this); this.handleMenuItemClick = this.handleMenuItemClick.bind(this); this.handleMenuClose = this.handleMenuClose.bind(this); + this.leaveRoom = this.leaveRoom.bind(this); } componentDidUpdate(prevProps) { @@ -47,24 +47,28 @@ class Header extends Component { } } - handleMenuClick({ target }) { - this.setState({ anchorEl: target }); + handleMenuOpen(event) { + this.setState({ anchorEl: event.target }); } handleMenuItemClick(option: string) { const route = RouteEnum[option.toUpperCase()]; this.props.history.push(generatePath(route)); - - this.handleMenuClose(); } handleMenuClose() { this.setState({ anchorEl: null }); } + leaveRoom(event, roomId) { + event.preventDefault(); + RoomsService.leaveRoom(roomId); + }; + render() { - const { joinedRooms, server, state, user } = this.props; - const anchorEl = this.state.anchorEl; + const { joinedRooms, state, user } = this.props; + const { anchorEl } = this.state; + let options = [ ...this.options ]; if (user && AuthenticationService.isModerator(user)) { @@ -76,36 +80,70 @@ class Header extends Component { } return ( -
- {/*
*/} - - -
- - logo - - { AuthenticationService.isConnected(state) && ( - - ) } -
+ + +
+ + logo + { AuthenticationService.isConnected(state) && ( -
-
+
+ +
+ ) } + + ) } } -const Rooms = props => { - - const onLeaveRoom = (event, roomId) => { - event.preventDefault(); - RoomsService.leaveRoom(roomId); - }; - - return
- Rooms: - { - _.reduce(props.rooms, (rooms, { name, roomId}) => { - rooms.push( - - onLeaveRoom(event, roomId)} /> - - ); - return rooms; - }, []) - } -
-}; - interface HeaderProps { state: number; server: string; @@ -172,7 +177,7 @@ interface HeaderProps { } interface HeaderState { - anchorEl: Element; + anchorEl: Element } const mapStateToProps = state => ({ diff --git a/webclient/src/components/ThreePaneLayout/ThreePaneLayout.css b/webclient/src/components/ThreePaneLayout/ThreePaneLayout.css index a0000d87..d11fe5d7 100644 --- a/webclient/src/components/ThreePaneLayout/ThreePaneLayout.css +++ b/webclient/src/components/ThreePaneLayout/ThreePaneLayout.css @@ -26,9 +26,11 @@ height: 100%; width: 100%; flex-shrink: 1; + overflow: hidden; } .three-pane-layout .grid-main__top.fixedHeight, .three-pane-layout .grid-main__bottom.fixedHeight { height: 50%; + overflow: visible; } diff --git a/webclient/src/containers/Room/Room.css b/webclient/src/containers/Room/Room.css index 69edb8c0..4b6aaec9 100644 --- a/webclient/src/containers/Room/Room.css +++ b/webclient/src/containers/Room/Room.css @@ -1,4 +1,5 @@ .room-view, +.room-view__main, .room-view__games, .room-view__messages, .room-view__messages-content, @@ -6,12 +7,17 @@ height: 100%; } +.room-view, .room-view__messages, .room-view__side { display: flex; flex-direction: column; } +.room-view__main { + overflow: hidden; +} + .room-view__messages-sayMessage { width: 100%; margin: 10px auto 2px; diff --git a/webclient/src/containers/Room/Room.tsx b/webclient/src/containers/Room/Room.tsx index 612be7a1..f37b7dad 100644 --- a/webclient/src/containers/Room/Room.tsx +++ b/webclient/src/containers/Room/Room.tsx @@ -53,45 +53,48 @@ class Room extends Component { return (
- - - - )} +
+ - - - )} /> - - - - -
- )} + top={( + + + + )} - side={( - -
- Users in this room: {users.length} + bottom={( +
+ + + )} /> + + + +
- users[index].name } - items={ users.map(user => ( - - - - ) ) } - /> - - )} - /> + )} + + side={( + +
+ Users in this room: {users.length} +
+ users[index].name } + items={ users.map(user => ( + + + + ) ) } + /> +
+ )} + /> +
); } diff --git a/webclient/src/containers/Server/Server.tsx b/webclient/src/containers/Server/Server.tsx index 0c98671c..4d086b0b 100644 --- a/webclient/src/containers/Server/Server.tsx +++ b/webclient/src/containers/Server/Server.tsx @@ -95,7 +95,9 @@ const ServerRooms = ({ rooms, joinedRooms, history, message, users}) => ( )} bottom={( - + +
+ )} side={( diff --git a/webclient/src/index.css b/webclient/src/index.css index 385b90a0..ca1be1c8 100644 --- a/webclient/src/index.css +++ b/webclient/src/index.css @@ -40,6 +40,11 @@ b { font-weight: bold; } +a { + color: inherit; + text-decoration: none; +} + .overflow-scroll { overflow-y: scroll; /* has to be scroll, not auto */ -webkit-overflow-scrolling: touch; @@ -54,4 +59,8 @@ b { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; +} + +.disabled-link { + pointer-events: none; } \ No newline at end of file