Improved welcome screen

This commit is contained in:
Alejandro Celaya
2020-12-20 12:17:12 +01:00
parent fa949cde12
commit 260a6c4940
14 changed files with 203 additions and 52 deletions

View File

@@ -1,7 +1,11 @@
@import '../utils/base';
@import '../utils/mixins/vertical-align';
.servers-list__list-group {
.servers-list__list-group.servers-list__list-group {
width: 100%;
}
.servers-list__list-group:not(.servers-list__list-group--embedded) {
max-width: 400px;
box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
}
@@ -12,8 +16,27 @@
padding: .75rem 2.5rem .75rem 1rem;
}
.servers-list__server-item:hover {
background-color: $lightColor;
}
.servers-list__server-item-icon {
@include vertical-align();
right: 1rem;
}
.servers-list__list-group--embedded.servers-list__list-group--embedded {
border-radius: 0;
border-top: 1px solid rgba(0, 0, 0, .125);
@media (min-width: $mdMin) {
max-height: 220px;
overflow-x: auto;
}
.servers-list__server-item {
border: none;
border-bottom: 1px solid rgba(0, 0, 0, .125);
}
}

View File

@@ -1,6 +1,7 @@
import { FC } from 'react';
import { ListGroup, ListGroupItem } from 'reactstrap';
import { Link } from 'react-router-dom';
import classNames from 'classnames';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faChevronRight as chevronIcon } from '@fortawesome/free-solid-svg-icons';
import { ServerWithId } from './data';
@@ -8,6 +9,7 @@ import './ServersListGroup.scss';
interface ServersListGroup {
servers: ServerWithId[];
embedded?: boolean;
}
const ServerListItem = ({ id, name }: { id: string; name: string }) => (
@@ -17,13 +19,13 @@ const ServerListItem = ({ id, name }: { id: string; name: string }) => (
</ListGroupItem>
);
const ServersListGroup: FC<ServersListGroup> = ({ servers, children }) => (
const ServersListGroup: FC<ServersListGroup> = ({ servers, children, embedded = false }) => (
<>
<div className="container">
<h5>{children}</h5>
</div>
{children && <h5 className="mb-md-3">{children}</h5>}
{servers.length > 0 && (
<ListGroup className="servers-list__list-group mt-md-3">
<ListGroup
className={classNames('servers-list__list-group', { 'servers-list__list-group--embedded': embedded })}
>
{servers.map(({ id, name }) => <ServerListItem key={id} id={id} name={name} />)}
</ListGroup>
)}