Skip to content

Commit

Permalink
Merge pull request #1131 from data-for-change/dev
Browse files Browse the repository at this point in the history
merge dev into master
  • Loading branch information
atalyaalon authored Oct 22, 2024
2 parents 00385a5 + 83b3723 commit 7e1c8ab
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
Binary file added src/assets/card-bg-road-oryarok.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/components/molecules/UserProfileHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const useStyles = makeStyles((theme) => ({
color: `${oceanBlueColor}`,
padding: theme.spacing(1),
textDecoration: 'none',
fontFamily: 'Rubik',
'&:hover': {
color: `${skyBlueColor}`,
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/card/AnyWayCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const AnyWayCard: FC<IProps> = ({
<Card ref={refFn} className={classes.root} variant="outlined">
<Box height={sizes.height} width={sizes.width} position="relative" padding={3}>
{/* HEADER */}
{organizationData?.key !== 'n12'?<CardBackgroundImage variant={variant.header} />:<></>}
{organizationData?.key !== 'n12' ? (<CardBackgroundImage variant={variant.header} {...(organizationData?.key && { org: organizationData.key })} />) : null}
{variant.header !== HeaderVariant.None && (
<Box height={sizes.headerHeight} width="100%">
<CardHeader
Expand Down
16 changes: 14 additions & 2 deletions src/components/molecules/card/CardBackgroundImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ import { makeStyles, Theme } from '@material-ui/core';
import React, { FC } from 'react';
import { HeaderVariant } from 'services/widgets.style.service';
import CardBackgrounRoadImage from 'assets/card-bg-road.png';
import CardBackgrounRoadImageOrYarok from 'assets/card-bg-road-oryarok.png';
import CardBackgrounMapImage from 'assets/card-bg-map.png';

const ROAD_IMAGE_HEIGHT = 130;
const MAP_IMAGE_HEIGHT = '100%';
let backgroundImage = CardBackgrounRoadImage;

interface IProps {
variant: HeaderVariant;
org?: string;
}

const useStyles = makeStyles<Theme, IProps>((theme) => ({
Expand All @@ -21,16 +24,25 @@ const useStyles = makeStyles<Theme, IProps>((theme) => ({
},
}));

const CardBackgroundImage: FC<IProps> = ({ variant }) => {
const CardBackgroundImage: FC<IProps> = ({ variant, org = 'no_organization'}) => {
const classes = useStyles({ variant });
let src;
let height;

switch (org) {
case 'or_yarok':
backgroundImage = CardBackgrounRoadImageOrYarok;
break;
case 'no_organization':
backgroundImage = CardBackgrounRoadImage;
break;
}

switch (variant) {
case HeaderVariant.Centered:
case HeaderVariant.CenteredNoTitle:
case HeaderVariant.Logo:
src = CardBackgrounRoadImage;
src = backgroundImage;
height = ROAD_IMAGE_HEIGHT;
break;
case HeaderVariant.Label:
Expand Down

0 comments on commit 7e1c8ab

Please sign in to comment.