diff --git a/frontend/react/src/ui/components/olcallout.tsx b/frontend/react/src/ui/components/olcallout.tsx new file mode 100644 index 00000000..dcc9fd82 --- /dev/null +++ b/frontend/react/src/ui/components/olcallout.tsx @@ -0,0 +1,54 @@ +import React from "react"; +import { faSkull, faCamera, faFlag, faLink, faUnlink, faAngleDoubleRight, faExclamationCircle, faInfoCircle } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; + +// Error message callout, only to be used for error messages +export function ErrorCallout(props: { + title?: string, + description?: string +}) { + return
+ {props.title && ()} +
+ {props.title} +
+ {props.description} +
+
+
+} + +// General information callout for something that is just nice to know +export function InfoCallout(props: { + title?: string, + description?: string +}) { + return
+ {props.title && ()} +
+ {props.title} + {props.description && (
+ {props.description} +
)} +
+
+} + +// Used for the "You are playing as BLUE/RED Commander" callouts, only on the login page. Accepted values for coalition are 'blue' and 'red'. +export function CommandCallout(props: { + coalition?: string, +}) { + return
+ +
+ You are playing as + {props.coalition=='blue' ? ( +
BLUE COMMANDER
+ ) : ( +
RED COMMANDER
+ )} + + +
+
+} diff --git a/frontend/react/src/ui/modals/login.tsx b/frontend/react/src/ui/modals/login.tsx index 65c8e8c8..3533ac97 100644 --- a/frontend/react/src/ui/modals/login.tsx +++ b/frontend/react/src/ui/modals/login.tsx @@ -1,6 +1,7 @@ import React, { useState, version } from 'react' import { Modal } from './components/modal' import { Card } from './components/card' +import { ErrorCallout, InfoCallout, CommandCallout } from '../../ui/components/olcallout' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faArrowRight, faCheckCircle, faExternalLink, faLink, faUnlink } from '@fortawesome/free-solid-svg-icons' import { VERSION, connectedToServer } from '../../olympusapp' @@ -16,7 +17,7 @@ export function LoginModal(props: { const [password, setPassword] = useState(""); const [displayName, setDisplayName] = useState(""); - return + return
@@ -67,10 +68,8 @@ export function LoginModal(props: { } : -
- There was an issue connecting you dog cunt -
- } + +} :