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

Improve mobile view for a status header and its images #207

Merged
merged 1 commit into from
Mar 21, 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
21 changes: 13 additions & 8 deletions frontend/App/Statuses/Status/ProjectImage/ProjectImage.style.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import styled from 'styled-components';
import styled, { css } from 'styled-components';

export const Container = styled.div`
margin-right: 1rem;
import { fromSize } from '/frontend/style/size';

img {
border-radius: 0.25rem;
max-width: 6rem;
max-height: 6rem;
}
export const ProjectAvatar = styled.img`
border-radius: 0.25rem;
width: 3rem;
height: 3rem;
grid-row: 1;
grid-column: 1;

${fromSize.medium(css`
width: 6rem;
height: 6rem;
`)}
`;
8 changes: 2 additions & 6 deletions frontend/App/Statuses/Status/ProjectImage/ProjectImage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ReactElement, useState } from 'react';

import { Container } from './ProjectImage.style';
import { ProjectAvatar } from './ProjectImage.style';

type Props = {
url: string;
Expand All @@ -14,11 +14,7 @@ const ProjectImage = ({ url, alt }: Props): ReactElement | null => {
return null;
}

return (
<Container>
<img src={url} alt={alt} onError={() => setNotLoading(true)} />
</Container>
);
return <ProjectAvatar src={url} alt={alt} onError={() => setNotLoading(true)} />;
};

export default ProjectImage;
35 changes: 30 additions & 5 deletions frontend/App/Statuses/Status/Status.style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ export const LinkBox = styled.a`
`;

export const Details = styled.div`
flex-grow: 1;
flex-shrink: 1;
min-width: 5rem;
grid-column: 2;
grid-row: 1 / 3;

${fromSize.medium(css`
grid-row: 1;
`)}
`;

export const Project = styled.h1`
Expand Down Expand Up @@ -94,15 +98,36 @@ export const Container = styled.div<StatusProps>`

export const Body = styled.div`
padding: 0.75rem;
display: flex;
display: grid;
grid-template-columns: 1fr 50fr;
grid-template-rows: 3rem 1fr;
gap: 0.5rem;

${fromSize.medium(css`
grid-template-columns: 1fr 50fr 1fr;
grid-template-rows: 1fr;
gap: 1rem;
`)}
`;

export const UserImage = styled.div`
flex-shrink: 0;
grid-column: 1;
grid-row: 2;

${fromSize.medium(css`
grid-column: 3;
grid-row: 1;
`)}

img {
border-radius: 50%;
width: 6rem;
height: 6rem;
width: 3rem;
height: 3rem;

${fromSize.medium(css`
width: 6rem;
height: 6rem;
`)}
}
`;
Loading