frontend: Some more styling

This commit is contained in:
Paul Bienkowski 2021-05-07 18:10:15 +02:00
parent 73e855550c
commit c380b0d1fb
6 changed files with 40 additions and 12 deletions

2
.dockerignore Normal file
View file

@ -0,0 +1,2 @@
local/
node_modules/

View file

@ -32,7 +32,7 @@ const App = connect((state) => ({login: state.login}))(function App({login}) {
{login && ( {login && (
<li> <li>
<Link to="/upload"> <Link to="/upload">
<Button compact color="green"> <Button compact primary>
<Icon name="cloud upload" /> <Icon name="cloud upload" />
Upload Upload
</Button> </Button>
@ -54,7 +54,7 @@ const App = connect((state) => ({login: state.login}))(function App({login}) {
<> <>
<li> <li>
<Link to="/settings"> <Link to="/settings">
<Avatar user={login} /> <Avatar user={login} className={styles.avatar} />
</Link> </Link>
</li> </li>
<li> <li>

View file

@ -11,6 +11,20 @@
align-items: center; align-items: center;
} }
.avatar {
width: 2.5em;
height: 2.5em;
display: inline-block;
vertical-align: -0.6em;
border-radius: 100%;
> img {
border-radius: 100%;
width: 100%;
height: 100%;
}
}
.headline { .headline {
left: 0; left: 0;
top: 0; top: 0;
@ -23,9 +37,13 @@
} }
.pageTitle { .pageTitle {
font-family: 'Roboto Slab'; font-family: 'Open Sans Condensed';
font-weight: 600; font-weight: 600;
font-size: 18pt; font-size: 18pt;
&, a, a:hover {
color: $obsColorB4;
}
} }
.menu { .menu {

View file

@ -1,5 +1,6 @@
import React from 'react' import React from 'react'
import {Comment} from 'semantic-ui-react' import {Comment} from 'semantic-ui-react'
import classnames from 'classnames'
import './styles.scss' import './styles.scss'
@ -17,21 +18,21 @@ function getColor(s) {
return `hsl(${h}, 50%, 50%)` return `hsl(${h}, 50%, 50%)`
} }
export default function Avatar({user}) { export default function Avatar({user, className}) {
const {image, username} = user || {} const {image, username} = user || {}
if (image) { if (image) {
return <Comment.Avatar src={image} /> return <Comment.Avatar src={image} className={className} />
} }
if (!username) { if (!username) {
return <div className="avatar empty-avatar" /> return <div className={classnames(className, "avatar", "empty-avatar")} />
} }
const color = getColor(username) const color = getColor(username)
return ( return (
<div className="avatar text-avatar" style={{background: color}}> <div className={classnames(className, "avatar", "text-avatar")} style={{background: color}}>
{username && <span>{username[0]}</span>} {username && <span>{username[0]}</span>}
</div> </div>
) )

View file

@ -12,10 +12,5 @@
@obsColorG6: #EFB509; @obsColorG6: #EFB509;
@obsColorS: #000000; @obsColorS: #000000;
@blue: #80A6CD;
@green: #78CB5B;
@orange: #D26911;
@black: #333333;
@primaryColor: @obsColorB4; @primaryColor: @obsColorB4;
@secondaryColor: @obsColorG1; @secondaryColor: @obsColorG1;

View file

@ -3,3 +3,15 @@
margin: 0 auto; margin: 0 auto;
padding: 0 16px; padding: 0 16px;
} }
$obsColorB4: #114594;
$obsColorG1: #76520E;
$obsColorW: #FFFFFF;
$obsColorB1: #122037;
$obsColorG6: #EFB509;
$obsColorS: #000000;
$primaryColor: $obsColorB4;
$secondaryColor: $obsColorG1;