Update client selection to match figma
This commit is contained in:
parent
18ad88f683
commit
a82c318ecf
11 changed files with 132 additions and 36 deletions
|
@ -20,7 +20,7 @@ limitations under the License.
|
||||||
background-color: $app-background;
|
background-color: $app-background;
|
||||||
background-image: url('./imgs/background.svg');
|
background-image: url('./imgs/background.svg');
|
||||||
background-repeat: none;
|
background-repeat: none;
|
||||||
background-position: 50% 10%;
|
background-position: 50% -20%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin spacer {
|
@mixin spacer {
|
||||||
|
|
|
@ -15,8 +15,6 @@ limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.advanced {
|
.advanced {
|
||||||
margin: 0 5%;
|
|
||||||
|
|
||||||
display: grid;
|
display: grid;
|
||||||
row-gap: 20px;
|
row-gap: 20px;
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,7 @@ const ClientSelection: React.FC<IProps> = ({ link }: IProps) => {
|
||||||
return (
|
return (
|
||||||
<div className="advanced">
|
<div className="advanced">
|
||||||
{options}
|
{options}
|
||||||
|
<h4>Clients you can accept this invite with</h4>
|
||||||
<ClientList link={link} rememberSelection={rememberSelection} />
|
<ClientList link={link} rememberSelection={rememberSelection} />
|
||||||
{clearSelection}
|
{clearSelection}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -19,17 +19,22 @@ limitations under the License.
|
||||||
.clientTile {
|
.clientTile {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
height: 155px;
|
min-height: 150px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
color: $foreground;
|
color: $foreground;
|
||||||
|
|
||||||
> img {
|
> img {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
height: 100%;
|
height: 130px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
> div {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
h1 {
|
h1 {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
@ -38,17 +43,25 @@ limitations under the License.
|
||||||
|
|
||||||
p {
|
p {
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
margin-top: 20px;
|
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
margin: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
border: 1px solid $borders;
|
border: 1px solid $borders;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
|
|
||||||
padding: 8px;
|
padding: 15px;
|
||||||
|
|
||||||
// For the chevron
|
// For the chevron
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
&::hover {
|
||||||
|
background-color: $grey;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.clientTileLink {
|
.clientTileLink {
|
||||||
|
|
|
@ -20,6 +20,7 @@ import classNames from 'classnames';
|
||||||
import { Client, ClientKind } from '../clients/types';
|
import { Client, ClientKind } from '../clients/types';
|
||||||
import { SafeLink } from '../parser/types';
|
import { SafeLink } from '../parser/types';
|
||||||
import Tile from './Tile';
|
import Tile from './Tile';
|
||||||
|
import Button from './Button';
|
||||||
|
|
||||||
import './ClientTile.scss';
|
import './ClientTile.scss';
|
||||||
|
|
||||||
|
@ -37,6 +38,12 @@ const ClientTile: React.FC<IProps> = ({ client, link }: IProps) => {
|
||||||
const className = classNames('clientTile', {
|
const className = classNames('clientTile', {
|
||||||
clientTileLink: client.kind === ClientKind.LINKED_CLIENT,
|
clientTileLink: client.kind === ClientKind.LINKED_CLIENT,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const inviteButton =
|
||||||
|
client.kind === ClientKind.LINKED_CLIENT ? (
|
||||||
|
<Button>Accept invite</Button>
|
||||||
|
) : null;
|
||||||
|
|
||||||
let clientTile = (
|
let clientTile = (
|
||||||
<Tile className={className}>
|
<Tile className={className}>
|
||||||
<img src={client.logo} alt={client.name + ' logo'} />
|
<img src={client.logo} alt={client.name + ' logo'} />
|
||||||
|
@ -44,6 +51,7 @@ const ClientTile: React.FC<IProps> = ({ client, link }: IProps) => {
|
||||||
<h1>{client.name}</h1>
|
<h1>{client.name}</h1>
|
||||||
<p>{client.description}</p>
|
<p>{client.description}</p>
|
||||||
{inviteLine}
|
{inviteLine}
|
||||||
|
{inviteButton}
|
||||||
</div>
|
</div>
|
||||||
</Tile>
|
</Tile>
|
||||||
);
|
);
|
||||||
|
|
31
src/components/FakeProgress.scss
Normal file
31
src/components/FakeProgress.scss
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
/*
|
||||||
|
Copyright 2020 The Matrix.org Foundation C.I.C.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
@import '../color-scheme';
|
||||||
|
|
||||||
|
.fakeProgress {
|
||||||
|
width: 100%;
|
||||||
|
height: 4px;
|
||||||
|
background-color: lighten($grey, 50%);
|
||||||
|
border-radius: 4px;
|
||||||
|
|
||||||
|
> div {
|
||||||
|
width: 60%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: $foreground;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
}
|
27
src/components/FakeProgress.tsx
Normal file
27
src/components/FakeProgress.tsx
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
/*
|
||||||
|
Copyright 2020 The Matrix.org Foundation C.I.C.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import './FakeProgress.scss';
|
||||||
|
|
||||||
|
const FakeProgress = () => (
|
||||||
|
<div className="fakeProgress">
|
||||||
|
<div />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
export default FakeProgress;
|
|
@ -18,7 +18,11 @@ limitations under the License.
|
||||||
display: grid;
|
display: grid;
|
||||||
row-gap: 24px;
|
row-gap: 24px;
|
||||||
|
|
||||||
.advancedPlaceholder {
|
.inviteTileClientSelection {
|
||||||
height: 245px;
|
margin: 0 5%;
|
||||||
|
display: grid;
|
||||||
|
|
||||||
|
justify-content: space-between;
|
||||||
|
row-gap: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,10 +20,12 @@ import './InviteTile.scss';
|
||||||
|
|
||||||
import Tile from './Tile';
|
import Tile from './Tile';
|
||||||
import LinkButton from './LinkButton';
|
import LinkButton from './LinkButton';
|
||||||
|
import Button from './Button';
|
||||||
import ClientSelection from './ClientSelection';
|
import ClientSelection from './ClientSelection';
|
||||||
import { Client, ClientKind } from '../clients/types';
|
import { Client, ClientKind } from '../clients/types';
|
||||||
import { SafeLink } from '../parser/types';
|
import { SafeLink } from '../parser/types';
|
||||||
import TextButton from './TextButton';
|
import TextButton from './TextButton';
|
||||||
|
import FakeProgress from './FakeProgress';
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
|
@ -35,12 +37,15 @@ const InviteTile: React.FC<IProps> = ({ children, client, link }: IProps) => {
|
||||||
const [showAdvanced, setShowAdvanced] = useState(false);
|
const [showAdvanced, setShowAdvanced] = useState(false);
|
||||||
let invite: React.ReactNode;
|
let invite: React.ReactNode;
|
||||||
let advanced: React.ReactNode;
|
let advanced: React.ReactNode;
|
||||||
// This i s a hacky way to get a the overlapping list of client
|
|
||||||
// options working.
|
|
||||||
let advancedPlaceholder: React.ReactNode;
|
|
||||||
|
|
||||||
if (client === null) {
|
if (client === null) {
|
||||||
invite = null;
|
invite = showAdvanced ? (
|
||||||
|
<FakeProgress />
|
||||||
|
) : (
|
||||||
|
<Button onClick={() => setShowAdvanced(!showAdvanced)}>
|
||||||
|
Accept invite
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
let inviteUseString: string;
|
let inviteUseString: string;
|
||||||
|
|
||||||
|
@ -60,11 +65,7 @@ const InviteTile: React.FC<IProps> = ({ children, client, link }: IProps) => {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
const advancedToggle = showAdvanced ? (
|
const advancedToggle = (
|
||||||
<TextButton onClick={(): void => setShowAdvanced(!showAdvanced)}>
|
|
||||||
Hide advanced options
|
|
||||||
</TextButton>
|
|
||||||
) : (
|
|
||||||
<p>
|
<p>
|
||||||
{inviteUseString}
|
{inviteUseString}
|
||||||
<TextButton
|
<TextButton
|
||||||
|
@ -83,9 +84,23 @@ const InviteTile: React.FC<IProps> = ({ children, client, link }: IProps) => {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client === null || showAdvanced) {
|
if (showAdvanced) {
|
||||||
advanced = <ClientSelection link={link} />;
|
if (client === null) {
|
||||||
advancedPlaceholder = <div className="advancedPlaceholder" />;
|
advanced = (
|
||||||
|
<>
|
||||||
|
<h4>Pick an app to accept the invite with</h4>
|
||||||
|
<ClientSelection link={link} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
advanced = (
|
||||||
|
<>
|
||||||
|
<hr />
|
||||||
|
<h4>Change app</h4>
|
||||||
|
<ClientSelection link={link} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -93,9 +108,8 @@ const InviteTile: React.FC<IProps> = ({ children, client, link }: IProps) => {
|
||||||
<Tile className="inviteTile">
|
<Tile className="inviteTile">
|
||||||
{children}
|
{children}
|
||||||
{invite}
|
{invite}
|
||||||
{advancedPlaceholder}
|
<div className="inviteTileClientSelection">{advanced}</div>
|
||||||
</Tile>
|
</Tile>
|
||||||
{advanced}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -49,6 +49,11 @@ h1 {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h4 {
|
||||||
|
text-align: left;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: $link;
|
color: $link;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
|
@ -10,9 +10,4 @@
|
||||||
row-gap: 60px;
|
row-gap: 60px;
|
||||||
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.advanced {
|
|
||||||
position: relative;
|
|
||||||
top: -335px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue