|
1 | 1 | import {JSX} from "react"; |
2 | | -import {Link} from "react-router"; |
| 2 | +import {Link, NavLink, NavigateFunction, useNavigate} from "react-router"; |
| 3 | + |
| 4 | +import useAppHistory from "../AppHistory"; |
3 | 5 | import CustomSVG from "./CustomSVG"; |
4 | 6 |
|
5 | 7 | function Header(): JSX.Element { |
| 8 | + const appHistory: object = useAppHistory(); |
| 9 | + |
| 10 | + const navigate: NavigateFunction = useNavigate(); |
| 11 | + |
6 | 12 | return ( |
7 | 13 | <header> |
8 | | - <div style={{display:'flex',justifyContent:'space-between',overflow:'hidden',padding:'10px 16px',whiteSpace:'nowrap'}}> |
9 | | - <div style={{justifyContent:'flex-start'}}> |
10 | | - <Link className="hoverHeaderButton" style={{fill:'white',textDecoration:'none'}} to="/"> |
11 | | - <CustomSVG icon="logo" style={{height:'40px',verticalAlign:'middle',width:'40px'}} viewBox="0 0 322 254"/> |
12 | | - <span style={{fontSize:'16px',fontWeight:'700',marginLeft:'10px',verticalAlign:'middle'}}>LBRY Web</span> |
| 14 | + <div style={{ |
| 15 | + display: 'flex', |
| 16 | + justifyContent: 'space-between', |
| 17 | + overflow: 'hidden', |
| 18 | + padding: '10px 16px', |
| 19 | + whiteSpace: 'nowrap' |
| 20 | + }}> |
| 21 | + <div style={{justifyContent: 'flex-start'}}> |
| 22 | + <Link className="hoverHeaderButtonFill" to="#menu" style={{ |
| 23 | + backgroundColor: 'rgba(45, 45, 45, 0.7)', |
| 24 | + borderRadius: '1.5rem', |
| 25 | + display: 'inline-block', |
| 26 | + height: '40px', |
| 27 | + textAlign: 'center', |
| 28 | + verticalAlign: 'middle', |
| 29 | + width: '40px' |
| 30 | + }}> |
| 31 | + <CustomSVG icon="menu" viewBox="0 0 24 24" style={{height: '16px', padding: '12px 0'}}/> |
| 32 | + </Link> |
| 33 | + <Link className="hoverHeaderButton" |
| 34 | + style={{fill: 'white', margin: '0 10px', textDecoration: 'none'}} to="/"> |
| 35 | + <CustomSVG icon="logo" style={{height: '40px', verticalAlign: 'middle', width: '40px'}} |
| 36 | + viewBox="0 0 322 254"/> |
| 37 | + <span style={{ |
| 38 | + fontSize: '16px', |
| 39 | + fontWeight: '700', |
| 40 | + marginLeft: '10px', |
| 41 | + verticalAlign: 'middle' |
| 42 | + }}>LBRY Web</span> |
13 | 43 | </Link> |
14 | 44 | </div> |
15 | | - <div style={{justifyContent:'center'}}> |
16 | | - {/*TODO CENTER*/} |
| 45 | + <div style={{justifyContent: 'center'}}> |
| 46 | + <NavLink className="hoverHeaderButtonFill" disabled={appHistory.getPrevious().length === 0} |
| 47 | + onClick={(appHistory.getPrevious().length > 0)?((): void => {navigate(-1)}):null} to={null} style={{ |
| 48 | + backgroundColor: 'rgba(45, 45, 45, 0.7)', |
| 49 | + borderRadius: '1.5rem', |
| 50 | + display: 'inline-block', |
| 51 | + height: '40px', |
| 52 | + marginRight: '10px', |
| 53 | + textAlign: 'center', |
| 54 | + verticalAlign: 'middle', |
| 55 | + width: '40px' |
| 56 | + }}> |
| 57 | + <CustomSVG icon="arrow-left" viewBox="0 0 24 24" |
| 58 | + style={{height: '18px', padding: '11px 0'}}/> |
| 59 | + </NavLink> |
| 60 | + <NavLink className="hoverHeaderButtonFill" disabled={appHistory.getNext().length === 0} |
| 61 | + onClick={(appHistory.getNext().length > 0)?((): void => {navigate(1)}):null} to={null} style={{ |
| 62 | + backgroundColor: 'rgba(45, 45, 45, 0.7)', |
| 63 | + borderRadius: '1.5rem', |
| 64 | + display: 'inline-block', |
| 65 | + height: '40px', |
| 66 | + marginRight: '10px', |
| 67 | + textAlign: 'center', |
| 68 | + verticalAlign: 'middle', |
| 69 | + width: '40px' |
| 70 | + }}> |
| 71 | + <CustomSVG icon="arrow-right" viewBox="0 0 24 24" |
| 72 | + style={{height: '18px', padding: '11px 0'}}/> |
| 73 | + </NavLink> |
17 | 74 | </div> |
18 | | - <div style={{justifyContent:'flex-end'}}> |
19 | | - <Link className="hoverHeaderButton" style={{backgroundColor:'rgba(45, 45, 45, 0.7)',borderRadius:'6px',display:'inline-block',height:'40px',margin:'0 10px',padding:'0 10px',textDecoration:'none',verticalAlign:'middle'}} to="/wallet"> |
20 | | - <CustomSVG icon="lbc" viewBox="0 0 24 24" style={{height:'16px',padding:'12px 0',verticalAlign:'middle'}}/> |
21 | | - <span style={{fontSize:'16px',fontWeight:'700',marginLeft:'6px',verticalAlign:'middle'}}>0.10</span> |
| 75 | + <div style={{justifyContent: 'flex-end'}}> |
| 76 | + <Link className="hoverHeaderButton" style={{ |
| 77 | + backgroundColor: 'rgba(45, 45, 45, 0.7)', |
| 78 | + borderRadius: '6px', |
| 79 | + display: 'inline-block', |
| 80 | + height: '40px', |
| 81 | + margin: '0 10px', |
| 82 | + padding: '0 10px', |
| 83 | + textDecoration: 'none', |
| 84 | + verticalAlign: 'middle' |
| 85 | + }} to="/wallet"> |
| 86 | + <CustomSVG icon="lbc" viewBox="0 0 24 24" |
| 87 | + style={{height: '16px', padding: '12px 0', verticalAlign: 'middle'}}/> |
| 88 | + <span style={{ |
| 89 | + fontSize: '16px', |
| 90 | + fontWeight: '700', |
| 91 | + marginLeft: '6px', |
| 92 | + verticalAlign: 'middle' |
| 93 | + }}>0.10</span> |
22 | 94 | </Link> |
23 | | - <Link className="hoverHeaderButtonFill" to="/settings" style={{backgroundColor:'rgba(45, 45, 45, 0.7)',borderRadius:'1.5rem',display:'inline-block',height:'40px',textAlign:'center',verticalAlign:'middle',width:'40px'}}> |
24 | | - <CustomSVG icon="account" viewBox="0 0 24 24" style={{height:'18px',padding:'11px 0'}}/> |
| 95 | + <Link className="hoverHeaderButtonFill" to="/settings" style={{ |
| 96 | + backgroundColor: 'rgba(45, 45, 45, 0.7)', |
| 97 | + borderRadius: '1.5rem', |
| 98 | + display: 'inline-block', |
| 99 | + height: '40px', |
| 100 | + textAlign: 'center', |
| 101 | + verticalAlign: 'middle', |
| 102 | + width: '40px' |
| 103 | + }}> |
| 104 | + <CustomSVG icon="account" viewBox="0 0 24 24" style={{height: '18px', padding: '11px 0'}}/> |
25 | 105 | </Link> |
26 | 106 | </div> |
27 | 107 | </div> |
|
0 commit comments