Skip to content

Commit

Permalink
search bar spacing styles
Browse files Browse the repository at this point in the history
  • Loading branch information
charmingduchess committed Nov 2, 2023
1 parent 950650e commit 8acd65d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 9 deletions.
6 changes: 4 additions & 2 deletions src/components/EDSLink.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { Box, Text, Link as DSLink } from "@nypl/design-system-react-components"
import React from "react"

import styles from "../../styles/components/Search.module.scss"

/**
* Renders a simple link to log out the user out from the Catalog.
*/
const EDSLink = () => {
return (
<Box mt="0" mb="0">
<Text size="body1" className="eds-link">
<Box className={styles.edsLink} mt="0" mb="0">
<Text size="body2" className="eds-link">
<span style={{ color: "var(--nypl-colors-ui-success-primary)" }}>
New!
</span>{" "}
Expand Down
13 changes: 11 additions & 2 deletions src/components/RCLink/RCLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,26 @@ interface RCLinkProps {
active?: boolean
href: string
children: ReactNode
className?: string
}

/**
* The RCLink component is a utility that wraps the design system Link component with
* Next's Link component to allow for correct navigation in Next per the design system's
* docs. It also includes an 'active' prop used for styling the SubNav component.
*/
const RCLink = ({ href, children, active = false, ...rest }: RCLinkProps) => {
const RCLink = ({
className,
href,
children,
active = false,
...rest
}: RCLinkProps) => {
return (
<Link href={href} passHref {...rest}>
<DSLink fontWeight={active && "bold"}>{children}</DSLink>
<DSLink className={className} fontWeight={active && "bold"}>
{children}
</DSLink>
</Link>
)
}
Expand Down
4 changes: 3 additions & 1 deletion src/components/SearchForm/SearchForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ const SearchForm = () => {
</div>
<div className={styles.auxSearchContainer}>
<EDSLink />
<RCLink href={"/search/advanced"}>Advanced Search</RCLink>
<RCLink className={styles.advancedSearch} href={"/search/advanced"}>
Advanced Search
</RCLink>
</div>
</div>
</div>
Expand Down
14 changes: 10 additions & 4 deletions styles/components/Search.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@
.auxSearchContainer {
display: flex;
justify-content: space-between;
margin: var(--nypl-space-xs) 0;
@media (max-width: 400px) {
flex-direction: column-reverse;
bottom-padding: var(--nypl-space-s);
align-items: flex-end;
}
a {
margin-top: var(--nypl-space-xs);
margin-bottom: var(--nypl-space-s);
}
}

.advancedSearch {
min-width: 127px;
margin-bottom: var(--nypl-space-s);
}

.edsLink {
padding-right: var(--nypl-space-xl);
}

0 comments on commit 8acd65d

Please sign in to comment.