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

D8CORE-7096 | @jdwjdwjdw | Update algolia search results styles and structure #747

Merged
merged 3 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ const Hit = ({hit}: HitsProps<StanfordHit>) => {

const Container = styled.div`
li {
margin-bottom: 40px;
margin-bottom: 30px;
border-bottom: 1px solid black;

&:last-child {
border-bottom: none;
}
}
`

Expand Down
21 changes: 10 additions & 11 deletions themes/stanford_basic/algolia-search/src/hits/default-hit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@ import {Highlight, Snippet} from "react-instantsearch";
const HitContainer = styled.article`
display: flex;
flex-direction: column;
gap: 40px;
justify-content: left;
padding: 20px;
margin-bottom: 20px;
justify-content: space-between;
gap: 4rem;
padding: 2rem 2rem 2rem 0;
margin-bottom: 2rem;

@media (min-width: 768px) {
flex-direction: row;
}

img {
max-width: 200px;
max-height: 200px;
max-width: 300px;
max-height: 300px;
object-fit: cover;
aspect-ratio: 1;
}
`

Expand All @@ -31,10 +30,7 @@ const DefaultHit = ({hit}) => {
const hitUrl = new URL(hit.url);

return (
<HitContainer className="su-card">
{hit.photo &&
<img src={hit.photo.replace(hitUrl.origin, '')} alt=""/>
}
<HitContainer>
<DetailsContainer>
<div>
<h2>
Expand Down Expand Up @@ -67,6 +63,9 @@ const DefaultHit = ({hit}) => {
</div>
}
</DetailsContainer>
{hit.photo &&
<img src={hit.photo.replace(hitUrl.origin, '')} alt=""/>
}
</HitContainer>
)
}
Expand Down
2 changes: 1 addition & 1 deletion themes/stanford_basic/algolia-search/src/search-box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const SearchBox = (props) => {
autoFocus
/>
</div>
<div style={{display: "flex", gap: "10px"}}>
<div style={{display: "flex", gap: "1rem", marginTop: "1rem"}}>
<button type="submit">Submit</button>
<button
type="reset"
Expand Down
Loading