From 1e7956d6b15b62af6436a4a518cc024cdf6ff0f7 Mon Sep 17 00:00:00 2001 From: Bilal Date: Fri, 9 Oct 2020 21:31:41 +0300 Subject: [PATCH] fix long gang name bug --- client/src/App.css | 15 +++++++++++++++ client/src/App.js | 18 +++++++++++++----- client/src/cash/Cash.js | 2 +- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/client/src/App.css b/client/src/App.css index 2085026..f350d84 100644 --- a/client/src/App.css +++ b/client/src/App.css @@ -58,4 +58,19 @@ .bump { margin-left: 2em; +} + +.overflow { + width: 120px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.clickable { + cursor: pointer; +} + +.no-overflow { + white-space: nowrap; } \ No newline at end of file diff --git a/client/src/App.js b/client/src/App.js index f3b996a..8996e1c 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react'; import './App.css'; -import { Navbar, Dropdown, Icon } from 'react-materialize'; +import { Navbar, Dropdown, Button } from 'react-materialize'; import Flow from "./homies/Flow"; import Cash from './cash/Cash'; import Homies from './homies/Homies'; @@ -77,9 +77,17 @@ const App = (props) => { ); + const gangName = () => { + if (selectedGang && selectedGang.name && selectedGang.name.length > 0){ + return selectedGang.name; + } + + return '[No name]'; + } + const navbarLogoWithGang = (
- GKS + GKS { alignment: 'left', autoTrigger: true, closeOnClick: true, - constrainWidth: true, + constrainWidth: false, coverTrigger: false, hover: false, inDuration: 150, outDuration: 250 }} - trigger={{selectedGang && selectedGang.name && selectedGang.name.length > 0 ? `${selectedGang.name} gang` : '[No name gang]'}arrow_drop_down} + trigger={} > {gangs.map(gang => setSelectedGang(gang)}>{gang.name})} @@ -104,7 +112,7 @@ const App = (props) => { return (
- + Crib diff --git a/client/src/cash/Cash.js b/client/src/cash/Cash.js index 58cc5bd..02ff8c4 100644 --- a/client/src/cash/Cash.js +++ b/client/src/cash/Cash.js @@ -26,7 +26,7 @@ const Cash = (props) => { return ( - {homieLine.homie.name} + props.history.push(`/homie/${homieLine.homie.id}/flow`)}>{homieLine.homie.name} { formatTime(homieLine.work) }