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

III-6039 - Improve dashboard styling #927

Merged
merged 3 commits into from
Oct 16, 2024
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
53 changes: 39 additions & 14 deletions src/pages/dashboard/DashboardRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,25 @@ export const DashboardRow = ({
const [isImageHovered, setIsImageHovered] = useState(false);
const weights = getScopeWeights(scope);
const minimumScore = useMemo(() => getMinimumScore(weights), [weights]);
const croppedImageBaseUrl = 'https://images-acc-uitdatabank.imgix.net/';
const imageIdAndFormat = imageUrl?.split('/').at(-1);
const croppedImageUrl = imageUrl
? `${croppedImageBaseUrl}${imageIdAndFormat}?fit=crop&crop=auto&w=500&h=500`
: undefined;
return (
<Inline spacing={5} {...getInlineProps(props)} flex={1}>
{children}
<Inline width="100" alignItems="center">
<Inline alignItems="center">
{imageUrl && (
<Image src={imageUrl} alt={title} width={100} height={100} />
<Image
src={croppedImageUrl}
alt={title}
width={150}
height={150}
css={`
border-radius: 0.5rem 0 0 0.5rem;
`}
/>
)}
{!imageUrl && !isFinished && (
<span
Expand All @@ -81,7 +94,7 @@ export const DashboardRow = ({
<Box
css={`
${!isImageUploading &&
`border: 1px solid ${udbMainGrey}; border-radius: 0.5rem;
`border: 1px solid ${udbMainGrey}; border-radius: 0.5rem 0 0 0.5rem;
:hover {
border: 1px dashed ${udbMainPositiveGreen}; cursor: pointer;
}
Expand All @@ -92,8 +105,8 @@ export const DashboardRow = ({
}
`}
`}
width={100}
height={100}
width={150}
height={150}
display="flex"
justifyContent="center"
alignItems="center"
Expand All @@ -112,8 +125,11 @@ export const DashboardRow = ({
)}
{!imageUrl && isFinished && (
<Box
width={100}
height={100}
width={150}
height={150}
css={`
border-radius: 0.5rem 0 0 0.5rem;
`}
display="flex"
justifyContent="center"
alignItems="center"
Expand All @@ -122,13 +138,20 @@ export const DashboardRow = ({
<Image
src={`/assets/uit-logo.svg`}
alt="No image available"
width={45}
height={45}
width={70}
height={70}
/>
</Box>
)}
</Inline>
<Stack spacing={4} flex={1}>
<Stack
spacing={4}
flex={1}
css={`
padding: 1.5rem;
`}
justifyContent="center"
>
<Link
href={url}
color={getValue('listItem.color')}
Expand All @@ -137,8 +160,10 @@ export const DashboardRow = ({
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 35rem;
max-width: 38rem;
display: block;
font-size: 18px;
text-decoration: none;
`}
>
{title}
Expand All @@ -152,7 +177,7 @@ export const DashboardRow = ({
>
{scope !== ScopeTypes.ORGANIZERS && (
<Stack
width="22.5%"
width="27%"
spacing={3}
alignItems="flex-start"
css={`
Expand All @@ -171,7 +196,7 @@ export const DashboardRow = ({
</Stack>
)}
<Inline
width="22.5%"
width="25%"
justifyContent="flex-start"
alignItems="center"
css={!score && `visibility: hidden`}
Expand All @@ -185,7 +210,7 @@ export const DashboardRow = ({
/>
<Text marginLeft={3}>{`${score} / 100`}</Text>
</Inline>
<Inline width="22.5%" justifyContent="flex-start" alignItems="center">
<Inline width="25%" justifyContent="flex-start" alignItems="center">
<StatusIndicator label={status.label} color={status.color} />
</Inline>
<Inline width="22.5%" justifyContent="flex-end" alignItems="center">
Expand Down
6 changes: 0 additions & 6 deletions src/pages/dashboard/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,6 @@ const TabContent = ({
{items.map((item, index) => (
<List.Item
key={item['@id']}
paddingLeft={5}
paddingRight={5}
paddingBottom={5}
paddingTop={5}
backgroundColor={getValue('listItem.backgroundColor')}
css={`
margin-top: 1rem;
Expand Down Expand Up @@ -659,8 +655,6 @@ const Dashboard = (): any => {
activeBackgroundColor="white"
css={`
.nav-item.nav-link {
font-size: 1.1rem;
font-weight: 300;
color: ${textColor};
padding: 0;
margin-right: 1.5rem;
Expand Down
Loading