diff --git a/backend/Platform/templates/emails/base.html b/backend/Platform/templates/emails/base.html index d4887bac..7ad2f242 100644 --- a/backend/Platform/templates/emails/base.html +++ b/backend/Platform/templates/emails/base.html @@ -41,18 +41,15 @@ margin-left: -3px; } - .verification-block { + .verification-number { + display: inline-flex; + justify-content: center; + align-items: center; width: 40px; height: 55px; margin: 3px; border-radius: 2px; background-color: #E7E7E7; - display:flex; - justify-content: center; - align-items: center; - } - - .verification-number { font-weight: 600; font-size: 20px; color: #767676; diff --git a/backend/Platform/templates/emails/email_verification.html b/backend/Platform/templates/emails/email_verification.html index e911bcc9..002c2774 100644 --- a/backend/Platform/templates/emails/email_verification.html +++ b/backend/Platform/templates/emails/email_verification.html @@ -8,11 +8,9 @@
{% for num in verification_code %} -
- - {{ num }} - -
+ + {{ num }} + {% endfor %}
diff --git a/frontend/components/Accounts/Forms/ContactInput.tsx b/frontend/components/Accounts/Forms/ContactInput.tsx index 80104527..d90308e5 100644 --- a/frontend/components/Accounts/Forms/ContactInput.tsx +++ b/frontend/components/Accounts/Forms/ContactInput.tsx @@ -55,6 +55,7 @@ const FieldInput = ({ setShowAdd, setVerifyContact, setShowModal, + onCancel, }) => { const { addToast } = useToasts(); const [text, setText] = useState(""); @@ -90,7 +91,14 @@ const FieldInput = ({ setShowAdd(true); }; - return ; + return ( + + ); }; const MoreIndicator = ({ @@ -163,7 +171,7 @@ export const ExistingInput = ({ {isVerified && } {text} {isPrimary && ( - + PRIMARY )} @@ -172,13 +180,15 @@ export const ExistingInput = ({ UNVERIFIED )} - setModalIsOpen(true)} - onMakePrimary={onMakePrimary} - onReverify={onReverify} - /> + {!isVerified || onDelete ? ( + setModalIsOpen(true)} + onMakePrimary={onMakePrimary} + onReverify={onReverify} + /> + ) : undefined} ( ); -export const EditInput = ({ onConfirm, value, onChange }) => ( +export const EditInput = ({ onConfirm, value, onChange, onCancel }) => ( + ); @@ -238,14 +249,18 @@ ${contactType === ContactType.Email ? "email" : "phone messages"} again.`); } setShowModal(true); }} - onDelete={async () => { - try { - await deleteContact(contactType, id); - } catch (e) { - addToast("Delete contact failed"); - } - mutate(); - }} + onDelete={ + contactType === "email" && infolist.length === 1 + ? undefined + : async () => { + try { + await deleteContact(contactType, id); + } catch (e) { + addToast("Delete contact failed"); + } + mutate(); + } + } onMakePrimary={() => mutate(id, { primary: true })} key={id} isPrimary={primary} @@ -268,6 +283,7 @@ ${contactType === ContactType.Email ? "email" : "phone messages"} again.`); setShowAdd={setShowAdd} setShowModal={setShowModal} setVerifyContact={setVerifyContact} + onCancel={() => setShowAdd(true)} /> )} { return ( { col={2} row={1} alignItems="start" + margin > { /> + { fieldName="student.school" /> + Major(s) @@ -184,6 +194,7 @@ const Accounts = ({ user: initialUser }: { user: User }) => { fieldName="student.major" /> + Grad Year @@ -196,7 +207,9 @@ const Accounts = ({ user: initialUser }: { user: User }) => { )} - + diff --git a/frontend/components/Accounts/ui.ts b/frontend/components/Accounts/ui.ts index 5e245be1..fcaeacec 100644 --- a/frontend/components/Accounts/ui.ts +++ b/frontend/components/Accounts/ui.ts @@ -92,6 +92,7 @@ export const Text = styled.span` export const FormGroupHeader = styled.h3` font-style: normal; font-weight: 600; + font-size: 1.5rem; `; export const FormGroupGrid = styled.div` @@ -104,6 +105,7 @@ interface FormGroupItemProps { col: number; row: number; alignItems?: string; + margin?: boolean; } export const FormGroupItem = styled.div` @@ -111,6 +113,7 @@ export const FormGroupItem = styled.div` grid-row: ${(props) => props.row}; display: flex; align-items: ${(props) => (props.alignItems ? props.alignItems : "center")}; + margin-bottom: ${(props) => (props.margin ? ".8rem" : "0")}; `; export const FormInput = styled.input<{ height?: string; error?: boolean }>` @@ -124,16 +127,26 @@ export const FormInput = styled.input<{ height?: string; error?: boolean }>` padding-left: 0.3rem; `; -export const Indicator = styled.img<{ paddingTop?: string }>` - width: 1rem; +export const Indicator = styled.img<{ paddingTop?: string; width?: string }>` + width: ${(props) => props.width ?? "1rem"}; padding-top: ${(props) => props.paddingTop}; cursor: pointer; + + &:hover { + opacity: 0.5; + } `; -export const Tag = styled.div` +const TagVariants = { + default: { col: "#767676", bg: "#e7e7e7" }, + primary: { col: "#455f7a", bg: "#adcced" }, +}; + +export const Tag = styled.div<{ variant?: keyof typeof TagVariants }>` height: 1rem; margin-top: 0.35rem; - background-color: #e7e7e7; + background-color: ${({ variant = "default" }) => TagVariants[variant].bg}; + color: ${({ variant = "default" }) => TagVariants[variant].col}; display: flex; align-items: center; justify-content: center; @@ -143,7 +156,6 @@ export const Tag = styled.div` margin: 0.2rem; font-size: 0.5rem; font-weight: 600; - color: #767676; } `; @@ -158,15 +170,22 @@ export const AddButton = styled.button<{ marginTop?: string }>` margin-top: ${(props) => props.marginTop}; `; -export const Button = styled.button<{ margin?: string }>` - background-color: #209cee; +export const Button = styled.button<{ + margin?: string; + backgroundColor?: string; + marginTop?: string; + fontSize?: string; +}>` + background-color: ${(props) => props.backgroundColor || "#209cee"}; color: #ffffff; border: none; border-radius: 0.2rem; cursor: pointer; + font-size: ${(props) => props.fontSize}; font-weight: 600; padding: 0.5rem 0.7rem 0.5rem 0.7rem; margin: ${(props) => props.margin}; + margin-top: ${(props) => props.marginTop}; `; export const selectStyles = { diff --git a/frontend/public/x-circle.svg b/frontend/public/x-circle.svg new file mode 100644 index 00000000..405cdc11 --- /dev/null +++ b/frontend/public/x-circle.svg @@ -0,0 +1 @@ + \ No newline at end of file