Skip to content

Commit

Permalink
style: header visual changes
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanoshadjipetrou committed Oct 30, 2024
1 parent 455feaa commit b20476d
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 22 deletions.
3 changes: 3 additions & 0 deletions src/app/components/header-menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ const HeaderMenuButton = styled(Button)({
"&:hover": {
background: "transparent",
},
"@media (max-width: 920px)": {
minWidth: "120px",
},
});

export const HeaderMenu: React.FC<HeaderMenuProps> = (
Expand Down
43 changes: 31 additions & 12 deletions src/app/components/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,17 @@ export const Header: React.FC = () => {
{searchOpen && (
<Box
sx={{
width: "500px",
maxWidth: "500px",
borderRadius: "23px",
width: "calc(100% - 48px)",
"#search-container": {
width: "100%",
height: "24px",
borderRadius: "23px",
input: {
fontSize: "12px",
borderRadius: "23px",
background: colors.primary.white,
},
},
"#search-icon": {
Expand All @@ -72,6 +78,7 @@ export const Header: React.FC = () => {
},
"#search-results-container": {
top: "35px",
width: "500px",
},
"> div": {
width: "100%",
Expand All @@ -85,10 +92,18 @@ export const Header: React.FC = () => {
onClick={onSearchBtnClick}
sx={{
padding: 0,
marginLeft: "10px",
marginLeft: "-24px",
background: colors.primary.black,
"> svg": {
transform: "scale(0.9)",
color: colors.primary.black,
transform: "scale(0.7)",
color: colors.primary.white,
},
"&:hover": {
opacity: 0.8,
background: colors.primary.black,
"> svg": {
color: colors.primary.white,
},
},
}}
>
Expand All @@ -108,13 +123,16 @@ export const Header: React.FC = () => {
return (
<Box
sx={{
top: "16px",
right: "0px",
display: "flex",
flexDirection: "row",
position: "absolute",
alignItems: "center",
justifyContent: "flex-end",
position: "absolute",
right: "0",
top: "16px",
"@media (max-width: 1216px)": {
right: "16px",
},
}}
>
{searchOpen && (
Expand Down Expand Up @@ -202,16 +220,17 @@ export const Header: React.FC = () => {
<Toolbar
sx={{
background: "#F8F8F8",
"@media (max-width: 1279px)": {
width: "100%",
},
"@media (max-width: 767px)": {
padding: "0 16px",
},
}}
>
{((mobile && !searchOpen) || !mobile) && (
<NavLink to="/" style={{ display: "flex" }}>
<HeaderToolbarLogo />
</NavLink>
)}
<NavLink to="/" style={{ display: "flex" }}>
<HeaderToolbarLogo />
</NavLink>
<HeaderMenu
mobileMenuOpen={mobileMenuOpen}
setMobileMenuOpen={setMobileMenuOpen}
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/search/data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const categories = [
{
value: "All Categories",
label: "All Categories",
icon: <AllCategoriesIcon />,
// icon: <AllCategoriesIcon />,
},
{ value: "Locations", label: "Locations", icon: <LocationsIcon /> },
{ value: "Grants", label: "Grants", icon: <GrantsIcon /> },
Expand Down
10 changes: 6 additions & 4 deletions src/app/components/search/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function SearchLayout(props: SearchLayoutProps) {
props.results.forEach((tab: SearchResultsTabModel) => {
allData = [...allData, ...tab.results];
});
if (!isMobile && props.category && props.category !== categories[0].label) {
if (props.category && props.category !== categories[0].label) {
const fIndex = findIndex(categories, { label: props.category }) - 1;
if (props.results[fIndex]) {
setData(props.results[fIndex].results);
Expand All @@ -93,7 +93,7 @@ export function SearchLayout(props: SearchLayoutProps) {

return (
<MobileContainer>
{!isMobile && props.category && props.setCategory && (
{props.category && props.setCategory && (
<Box id="search-category-dropdown" marginRight="16px">
<Dropdown
height={40}
Expand All @@ -107,8 +107,7 @@ export function SearchLayout(props: SearchLayoutProps) {
id="search-container"
theme={{
focused: open,
withCatMenu:
!isMobile && Boolean(props.category) && Boolean(props.setCategory),
withCatMenu: Boolean(props.category) && Boolean(props.setCategory),
}}
>
<Input
Expand Down Expand Up @@ -162,6 +161,9 @@ export function SearchLayout(props: SearchLayoutProps) {
alignItems: "center",
justifyContent: "center",
background: appColors.COMMON.BLACK,
"@media (max-width: 767px)": {
height: "35px",
},
}}
>
<SearchIcon htmlColor={appColors.COMMON.WHITE} />
Expand Down
11 changes: 6 additions & 5 deletions src/app/components/search/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ export const Container = styled(Box)`
border: 1px solid ${appColors.SEARCH.DROPDOWN_BUTTON_BORDER_COLOR};
width: ${(props) =>
props.theme.withCatMenu ? "calc(100% - 200px)" : "100%"};
@media (max-width: 767px) {
width: 100%;
}
`;

export const MobileContainer = styled(Box)`
width: 100%;
display: flex;
position: relative;
flex-direction: row;
background: transparent;
@media (min-width: 768px) {
display: flex;
flex-direction: row;
}
`;

export const Input = styled.input`
Expand Down

0 comments on commit b20476d

Please sign in to comment.