Skip to content

Commit 867fab5

Browse files
authored
Merge pull request #193 from AgainIoT/feature/191
Modify link in modal
2 parents 0b92e01 + b675212 commit 867fab5

File tree

2 files changed

+41
-15
lines changed

2 files changed

+41
-15
lines changed

src/components/common/template/TemplateBody.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ export default function TemplateBody(props) {
2626
}
2727

2828
const BodyBox = styled.div`
29-
display: flex,
30-
justify-content: center,
31-
align-items: center,
32-
height: 100%,
29+
display: flex;
30+
justify-content: center;
31+
align-items: center;
32+
height: 100%;
3333
overflow-x: hidden;
3434
overflow-y: auto;
3535
`;
36+

src/components/common/template/TemplateTitle.js

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import styled from "styled-components";
12
import { useRecoilState, useRecoilValue } from "recoil";
23
import { modalState } from "../../../recoil/commonState";
4+
import GITHUB from "../../../assets/icons/github.svg";
35
import {
46
templateContent,
57
templatePreviewState,
@@ -10,6 +12,7 @@ import Typography from "@mui/material/Typography";
1012
import Box from "@mui/material/Box";
1113
import Button from "@mui/material/Button";
1214
import LinkIcon from "@mui/icons-material/Link";
15+
import { blue } from "@mui/material/colors";
1316

1417
// props -> type(pr, readme, contributing)
1518
export default function TemplateTitle(props) {
@@ -52,22 +55,27 @@ export default function TemplateTitle(props) {
5255
alignItems: "center",
5356
}}
5457
>
55-
<Typography
56-
id="PR-desc"
57-
variant="h5"
58-
gutterBottom
59-
color="textSecondary"
60-
m={2}
61-
>
62-
{showValue.length ? showValue[0].subtitle : ""}
58+
<LinkEntireDiv>
6359
{showValue.length && showValue[0].repoUrl ? (
64-
<LinkIcon
60+
<LinkDiv
6561
onClick={() => {
6662
window.open(showValue[0].repoUrl);
6763
}}
68-
></LinkIcon>
64+
>
65+
<GithubImg src={GITHUB} />
66+
<Typography
67+
id="PR-desc"
68+
variant="h5"
69+
gutterBottom
70+
color="textSecondary"
71+
m={1}
72+
>
73+
{showValue[0].subtitle}&nbsp;
74+
<LinkIcon />
75+
</Typography>
76+
</LinkDiv>
6977
) : null}
70-
</Typography>
78+
</LinkEntireDiv>
7179
{showValue.length && showValue[0].id ? (
7280
<Button
7381
variant="contained"
@@ -83,3 +91,20 @@ export default function TemplateTitle(props) {
8391
</Box>
8492
);
8593
}
94+
95+
const GithubImg = styled.img`
96+
width: 2.3rem;
97+
height: 2.3rem;
98+
`;
99+
100+
const LinkEntireDiv = styled.div`
101+
display: flex;
102+
flex-direction: row;
103+
`;
104+
105+
const LinkDiv = styled.div`
106+
display: flex;
107+
align-items: center;
108+
flex-direction: row;
109+
margin-left: 1.8rem;
110+
`;

0 commit comments

Comments
 (0)