new login design (#4442)

* new login design

* remove effects file (wrong direction)

* add Known Hosts dropdown component

Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
This commit is contained in:
Jeremy Letto 2021-10-25 13:28:43 -05:00 committed by GitHub
parent 6f360374cc
commit d684a9c5fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 675 additions and 212 deletions

View file

@ -3,6 +3,7 @@ export enum FormKey {
ADD_TO_IGNORE = "ADD_TO_IGNORE",
CARD_IMPORT = "CARD_IMPORT",
CONNECT = "CONNECT",
LOGIN = "LOGIN",
REGISTER = "REGISTER",
SEARCH_LOGS = "SEARCH_LOGS",
}

View file

@ -1,10 +1,11 @@
export enum RouteEnum {
PLAYER = "/player/:name",
SERVER = "/server",
ROOM = "/room/:roomId",
LOGS = "/logs",
GAME = "/game",
DECKS = "/decks",
DECK = "/deck",
ACCOUNT = "/account",
PLAYER = '/player/:name',
SERVER = '/server',
ROOM = '/room/:roomId',
LOGIN = '/',
LOGS = '/logs',
GAME = '/game',
DECKS = '/decks',
DECK = '/deck',
ACCOUNT = '/account',
}

View file

@ -31,6 +31,48 @@ export enum StatusEnumLabel {
"Disconnecting" = 99
}
export class Host {
id?: number;
name: string;
host: string;
port: string;
localHost?: string;
localPort?: string;
editable: boolean;
}
export const DefaultHosts: Host[] = [
{
name: 'Rooster',
host: 'server.cockatrice.us/servatrice',
port: '4748',
localHost: 'server.cockatrice.us',
editable: false,
},
{
name: 'Tetrarch',
host: 'mtg.tetrarch.co/servatrice',
port: '4748',
editable: false,
},
];
export const getHostPort = (host: Host): { host: string, port: string } => {
const isLocal = window.location.hostname === 'localhost';
if (!host) {
return {
host: '',
port: ''
};
}
return {
host: !isLocal ? host.host : host.localHost || host.host,
port: !isLocal ? host.port : host.localPort || host.port,
}
};
export enum KnownHost {
ROOSTER = 'Rooster',
TETRARCH = 'Tetrarch',