Skip to content

WEB-63 Format blog page to display style #350

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

Merged
merged 5 commits into from
Jun 11, 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
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const EditorQuoteButton: FC = () => {
size={30}
onMouseDown={(event) => {
event.preventDefault();
toggleMark(editor, 'quote');
toggleMark(editor, "quote");
}}
/>
);
Expand Down
24 changes: 24 additions & 0 deletions next/src/components/blog/Blog-styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@ const Text = styled.span<TextStyle>`
text-decoration-line: ${(props) => (props.underline ? "underline" : "none")};
text-align: ${(props) => props.align};
font-size: ${(props) => `${props.textSize}px` ?? "16px"};
word-wrap: break-word;
font-family: ${(props) => props.code ? "monospace" : "inherit"};
background-color: ${(props) => props.code ? "#eee" : "#fff"};
color: ${(props) => (props.quote ? '#9e9e9e' : 'black')};
border-left: ${(props) => (props.quote ? "3px solid #9e9e9e" : "auto")};
margin: ${(props) => (props.quote ? "0px" : "auto")};
padding-left: ${(props) => (props.quote ? "10px" : "0px")};

min-width: 200px;
@media ${device.tablet} {
min-width: 500px;
}

@media (min-width: 1920px) {
min-width: 1250px;
}
`;

const AlignedText = Text.withComponent("div");
Expand All @@ -24,6 +40,14 @@ const ImagePlaceholder = styled.div`

const ParagraphContainer = styled.div`
padding: 10px;
min-width: 200px;
@media ${device.tablet} {
min-width: 500px;
}

@media (min-width: 1920px) {
min-width: 1250px;
}
`;

const BlogContainer = styled.div`
Expand Down
2 changes: 2 additions & 0 deletions next/src/components/blog/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export interface TextStyle {
bold?: boolean;
italic?: boolean;
underline?: boolean;
code?: boolean;
quote?: boolean;
align?: "left" | "right" | "center";
textSize: number;
}
4 changes: 2 additions & 2 deletions next/src/components/footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const Footer: React.FC<{}> = () => {
<Image src={CSESocLogo} alt="CSESoc" />
</Logo>
<Details>
<p>
<div>
B03 CSE Building K17, UNSW
<br />
csesoc@csesoc.org.au
Expand All @@ -87,7 +87,7 @@ const Footer: React.FC<{}> = () => {
</ImagesContainer>
<br /><br />
© 2022 — CSESoc UNSW
</p>
</div>
</Details>
</FooterComponent>
);
Expand Down
2 changes: 1 addition & 1 deletion next/src/pages/blog/[bid].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const BlogPage: NextPage<{ data: Block[] }> = ({ data }) => {

export const getServerSideProps: GetServerSideProps = async ({ params }) => {
const data = await fetch(
`/api/filesystem/get/published?DocumentID=${
`http://backend:8080/api/filesystem/get/published?DocumentID=${
params && params.bid
}`,
{
Expand Down