Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCC-4236: Username for My Account 2.0 #397

Merged
merged 28 commits into from
Nov 26, 2024
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
766b558
Start of username
7emansell Nov 15, 2024
7e67c6e
Pulling out status banner
7emansell Nov 19, 2024
47219eb
Start of username validation api route
7emansell Nov 19, 2024
cd54635
Removing discovery links from config and updating nyplApiClient
7emansell Nov 19, 2024
f116cf8
Username form and cleanup in other files
7emansell Nov 19, 2024
a6f7684
Tests (need more once deletion is confirmed)
7emansell Nov 20, 2024
e52407e
Clean up
7emansell Nov 20, 2024
673d296
One more test
7emansell Nov 20, 2024
bc995e2
Typooo
7emansell Nov 21, 2024
f1a87f8
Moving UsernameForm into list
7emansell Nov 22, 2024
ee979fc
Typo/import clean up
7emansell Nov 22, 2024
28e698d
Simplifying ternaries
7emansell Nov 22, 2024
303cf48
Removing ternaries and fixing alignment
7emansell Nov 25, 2024
d240835
Removing DISCOVERY_API_NAME
7emansell Nov 25, 2024
8ec5985
Removing more ternary
7emansell Nov 25, 2024
4a5e036
Styling updates
7emansell Nov 25, 2024
d78b943
Tweaking error handling on helper
7emansell Nov 25, 2024
013d510
Changing deletion strategy
7emansell Nov 25, 2024
b17b5a1
Adding deletion test and defining tempInput null meaning
7emansell Nov 25, 2024
6570b9f
Commenting
7emansell Nov 25, 2024
0bcf57d
More clean up
7emansell Nov 25, 2024
bc4f37e
Variable name updates
7emansell Nov 25, 2024
63aa14e
More styling tweaks
7emansell Nov 25, 2024
f1e65a6
styling
7emansell Nov 25, 2024
2863e93
Starting to fix helper error text
7emansell Nov 26, 2024
5e720be
using ui.link.primary where possible
7emansell Nov 26, 2024
3b317c3
more changes
7emansell Nov 26, 2024
e7bf689
Tests corrected
7emansell Nov 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Styling updates
7emansell committed Nov 25, 2024
commit 4a5e03649cbfe559c03894802d00e31d0dc08295
2 changes: 1 addition & 1 deletion src/components/MyAccount/NewSettings/StatusBanner.tsx
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ const specificFailureContent = (statusMessage: string) => {
<Link
sx={{
color: "ui.link.primary !important",
textDecorationColor: "ui.link.primary !important",
textDecorationColor: "var(--nypl-colors-ui-link-primary) !important",
textDecoration: "underline",
}}
href="https://www.nypl.org/get-help/contact-us"
10 changes: 9 additions & 1 deletion src/components/MyAccount/NewSettings/UsernameForm.tsx
Original file line number Diff line number Diff line change
@@ -110,7 +110,10 @@ const UsernameForm = ({ patron, usernameState }: UsernameFormProps) => {
display: "flex",
flexDirection: "column-reverse",
label: {
paddingTop: "xxs",
fontWeight: "400",
fontSize: "12px",
lineHeight: "150%",
color: error ? "ui.error.primary" : "ui.black",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should happen automatically when isInvalid is true. Or is this because the additional !validateUsername check below affects the text color?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because the label and the invalid text are the same copy, and render in the same place (below the field). Since that's not how this component expects to work, I'm manually making the label text become the invalid text when needed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use helperText here instead of labelText? It looks like the helper text is automatically with the correct styling for this.

},
}}
@@ -192,7 +195,12 @@ const UsernameForm = ({ patron, usernameState }: UsernameFormProps) => {
let content
if (isLoading) {
content = (
<SkeletonLoader contentSize={2} showImage={false} headingSize={0} />
<SkeletonLoader
contentSize={2}
showImage={false}
headingSize={0}
sx={{ marginTop: "-s" }}
/>
)
} else if (isEditing) {
content = editingView