Skip to content

Commit 3c8d63f

Browse files
authored
WEB-63 Format blog page to display style (#350)
1 parent e4c0654 commit 3c8d63f

File tree

5 files changed

+30
-4
lines changed

5 files changed

+30
-4
lines changed

frontend/src/packages/editor/components/buttons/EditorQuoteButton.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const EditorQuoteButton: FC = () => {
1010
size={30}
1111
onMouseDown={(event) => {
1212
event.preventDefault();
13-
toggleMark(editor, 'quote');
13+
toggleMark(editor, "quote");
1414
}}
1515
/>
1616
);

next/src/components/blog/Blog-styled.tsx

+24
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,22 @@ const Text = styled.span<TextStyle>`
88
text-decoration-line: ${(props) => (props.underline ? "underline" : "none")};
99
text-align: ${(props) => props.align};
1010
font-size: ${(props) => `${props.textSize}px` ?? "16px"};
11+
word-wrap: break-word;
12+
font-family: ${(props) => props.code ? "monospace" : "inherit"};
13+
background-color: ${(props) => props.code ? "#eee" : "#fff"};
14+
color: ${(props) => (props.quote ? '#9e9e9e' : 'black')};
15+
border-left: ${(props) => (props.quote ? "3px solid #9e9e9e" : "auto")};
16+
margin: ${(props) => (props.quote ? "0px" : "auto")};
17+
padding-left: ${(props) => (props.quote ? "10px" : "0px")};
18+
19+
min-width: 200px;
20+
@media ${device.tablet} {
21+
min-width: 500px;
22+
}
23+
24+
@media (min-width: 1920px) {
25+
min-width: 1250px;
26+
}
1127
`;
1228

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

2541
const ParagraphContainer = styled.div`
2642
padding: 10px;
43+
min-width: 200px;
44+
@media ${device.tablet} {
45+
min-width: 500px;
46+
}
47+
48+
@media (min-width: 1920px) {
49+
min-width: 1250px;
50+
}
2751
`;
2852

2953
const BlogContainer = styled.div`

next/src/components/blog/types.ts

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ export interface TextStyle {
2727
bold?: boolean;
2828
italic?: boolean;
2929
underline?: boolean;
30+
code?: boolean;
31+
quote?: boolean;
3032
align?: "left" | "right" | "center";
3133
textSize: number;
3234
}

next/src/components/footer/Footer.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const Footer: React.FC<{}> = () => {
6363
<Image src={CSESocLogo} alt="CSESoc" />
6464
</Logo>
6565
<Details>
66-
<p>
66+
<div>
6767
B03 CSE Building K17, UNSW
6868
<br />
6969
@@ -87,7 +87,7 @@ const Footer: React.FC<{}> = () => {
8787
</ImagesContainer>
8888
<br /><br />
8989
© 2022 — CSESoc UNSW
90-
</p>
90+
</div>
9191
</Details>
9292
</FooterComponent>
9393
);

next/src/pages/blog/[bid].tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const BlogPage: NextPage<{ data: Block[] }> = ({ data }) => {
4242

4343
export const getServerSideProps: GetServerSideProps = async ({ params }) => {
4444
const data = await fetch(
45-
`/api/filesystem/get/published?DocumentID=${
45+
`http://backend:8080/api/filesystem/get/published?DocumentID=${
4646
params && params.bid
4747
}`,
4848
{

0 commit comments

Comments
 (0)