1
+ import styled from "styled-components" ;
1
2
import { useRecoilState , useRecoilValue } from "recoil" ;
2
3
import { modalState } from "../../../recoil/commonState" ;
4
+ import GITHUB from "../../../assets/icons/github.svg" ;
3
5
import {
4
6
templateContent ,
5
7
templatePreviewState ,
@@ -10,6 +12,7 @@ import Typography from "@mui/material/Typography";
10
12
import Box from "@mui/material/Box" ;
11
13
import Button from "@mui/material/Button" ;
12
14
import LinkIcon from "@mui/icons-material/Link" ;
15
+ import { blue } from "@mui/material/colors" ;
13
16
14
17
// props -> type(pr, readme, contributing)
15
18
export default function TemplateTitle ( props ) {
@@ -52,22 +55,27 @@ export default function TemplateTitle(props) {
52
55
alignItems : "center" ,
53
56
} }
54
57
>
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 >
63
59
{ showValue . length && showValue [ 0 ] . repoUrl ? (
64
- < LinkIcon
60
+ < LinkDiv
65
61
onClick = { ( ) => {
66
62
window . open ( showValue [ 0 ] . repoUrl ) ;
67
63
} }
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 }
74
+ < LinkIcon />
75
+ </ Typography >
76
+ </ LinkDiv >
69
77
) : null }
70
- </ Typography >
78
+ </ LinkEntireDiv >
71
79
{ showValue . length && showValue [ 0 ] . id ? (
72
80
< Button
73
81
variant = "contained"
@@ -83,3 +91,20 @@ export default function TemplateTitle(props) {
83
91
</ Box >
84
92
) ;
85
93
}
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