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

Local footer styling to match Stanford Basic subtheme #5

Open
wants to merge 13 commits into
base: 1.x
Choose a base branch
from

Conversation

jenbreese
Copy link
Contributor

@jenbreese jenbreese commented Mar 12, 2024

NOT READY FOR REVIEW

  • (Edit the above to reflect status)

Summary

  • Added the web login button. It needs the correct saml login link. I added it to the bottom of the local footer like ChEM-H did.
  • Added font sizing.
  • Added spacing.
  • Added the subscription form.
  • I grouped and commented what the different variables are because the names are confusing.
  • Questions for @pookmish
    -- How can we include the lockup that we use in the header? Is there a way to make the footer one use the main one in the story? I read a little about storybook compositions. Maybe that is what I'm looking for?

Review By (Date)

  • When does this need to be reviewed by?

Criticality

  • How critical is this PR on a 1-10 scale? Also see Severity Assessment.
  • E.g., it affects one site, or every site and product?

Urgency

  • How urgent is this? (Normal, High)

Review Tasks

Setup tasks and/or behavior to test

  1. Check out this branch
  2. Rebuild Cache and import config drush cr ; drush ci
  3. Navigate to...
  4. Verify...

Site Configuration Sync

  • Is there a config:export in this PR that changes the config sync directory?

Front End Validation

Backend / Functional Validation

Code

  • Are the naming conventions following our standards?
  • Does the code have sufficient inline comments?
  • Is there anything in this code that would be hidden or hard to discover through the UI?
  • Are there any code smells?
  • Are tests provided? eg (unit, behat, or codeception)

Code security

General

  • Is there anything included in this PR that is not related to the problem it is trying to solve?
  • Is the approach to the problem appropriate?

Affected Projects or Products

  • Does this PR impact any particular projects, products, or modules?

Associated Issues and/or People

  • JIRA ticket(s)
  • Other PRs
  • Any other contextual information that might be helpful (e.g., description of a bug that this PR fixes, new functionality that it adds, etc.)
  • Anyone who should be notified? (@mention them here)

Resources

@jenbreese
Copy link
Contributor Author

@pookmish Can you take a look at this PR and offer suggestions for improvement?

import {LockClosedIcon} from "@heroicons/react/24/outline";
import Link from "next/link";

const WebLogin = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm good with most of this PR, except this component. Since it's a decoupled site, we'll basically be hiding the web login and hiding the drupal side. At this time I'd like to remove this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. That makes sense. I removed it.

Comment on lines 159 to 161
<div>
<div className="su-signup-form">
<Wysiwyg html={suLocalFootFIntro?.processed}/>
<Subscribe/>
</div>

<Wysiwyg html={suLocalFootTrCo?.processed}/>

</div>
<Wysiwyg html={suLocalFootTrCo?.processed} className="text-19"/>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

This section could probably have more simple markup:

<div>
  <Wysiwyg html={suLocalFootFIntro?.processed}/>
  <Subscribe/>
  <Wysiwyg html={suLocalFootTrCo?.processed} className="text-19"/>
</div>

And even more so, does the wrapping div need to be there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The wrapping is not needed and had some wrong thinking behind it.

@@ -38,7 +38,7 @@ const Address = ({
}

return (
<address {...props}>
<address {...props} className="text-16 leading-9 rs-mb-3">
Copy link
Contributor

Choose a reason for hiding this comment

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

Remember that the Address element is used across the whole site. If you want to apply these classes in the footer, you should apply them where the component is used. That's what the {...props} allows us to do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. I moved it to the footer instead. I'll look again in the am. I might have missed the point.

Comment on lines 5 to 9
<form>
<input className="h-[3.5rem] w-[25rem] block type-0" type="email" id="" aria-label="signup email" name="signup email" placeholder="email address" />
<button className="button m-t-3 my-2 h-[35px]" type="submit" id="signup-submit">
Sign-up
</button>
Copy link
Contributor

Choose a reason for hiding this comment

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

This form wouldn't submit anywhere the way it is. At this time, we should just remove it. I don't believe people use the local footer signup form anywhere anyways.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think many sites do but ChEM-H does. They aren't going to use this at the moment. I removed it. It'd be interesting to know how many actually use it.

@@ -3,7 +3,9 @@ import type {Meta, StoryObj} from '@storybook/react';
import LocalFooter from "@components/config-pages/local-footer";
import {ComponentProps} from "react";

type ComponentStoryProps = ComponentProps<typeof LocalFooter> & {}
type ComponentStoryProps = ComponentProps<typeof LocalFooter> & {
numberoflinks: number
Copy link
Contributor

Choose a reason for hiding this comment

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

For ease of reading and consistent code styles, it's good to use camel case characters. numberOfLinks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the name of numberOfLinks and noticed I had the same style problem in the gallery page so I fixed that too.

for (let i=0; i< numberOfLinks; i++) {
linkList.push("<a href='http://localhost'>Primary Link</a>")
}
return <LocalFooter {...args} />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pookmish Can you point out where this is wrong? I thought I'd be able to pass the linkList into the return like <LocalFooter {linkList, ...args} /> but that was an error. I want the control to just add more links so the client can see what happens in the display when they add lots of links.

Copy link
Contributor

Choose a reason for hiding this comment

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

you're creating an array, but you're not doing anything with the array. Also links are typically structured objects, so you'd need to do something like linkList.push({url: "http:/foobar", title: "foo"})
But then once you build the array, you need to set it to the args. args.configPage.[your_field_name] = linkList

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean like this?

args: {
    configPage: {
      suLocalFootAction: linkList,
    },

@pookmish pookmish force-pushed the local-footer-styling branch from de0308a to d61b08b Compare April 5, 2024 18:24
Copy link
Contributor

@pookmish pookmish left a comment

Choose a reason for hiding this comment

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

This still requires fixes to the storybook story

@pookmish pookmish force-pushed the 1.x branch 2 times, most recently from 6524635 to a9f4c29 Compare July 10, 2024 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants