This repository was archived by the owner on May 4, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +71
-23
lines changed Expand file tree Collapse file tree 7 files changed +71
-23
lines changed Original file line number Diff line number Diff line change 3
3
4
4
"name" : " Codiga" ,
5
5
"description" : " Create, share and use Code Snippets from your browser" ,
6
- "version" : " 0.0.12 " ,
6
+ "version" : " 0.0.13 " ,
7
7
8
8
"options_ui" : {
9
9
"page" : " options.html" ,
Original file line number Diff line number Diff line change
1
+ import React from "react" ;
2
+
3
+ export default function CodigaIcon ( ) {
4
+ return (
5
+ < svg
6
+ width = "24"
7
+ height = "24"
8
+ viewBox = "0 0 24 24"
9
+ fill = "none"
10
+ xmlns = "http://www.w3.org/2000/svg"
11
+ >
12
+ < path
13
+ d = "M12.2087 18L22.3306 12V18L12.2087 24L2.08691 18V6L12.2087 0L22.3306 6L12.2087 12L7.14785 9.00004V15L12.2087 18Z"
14
+ fill = "url(#paint0_linear_1312_15167)"
15
+ />
16
+ < path
17
+ opacity = "0.6"
18
+ d = "M17.2698 8.99996L12.2088 12L7.14795 8.99996L12.2088 6L17.2698 8.99996Z"
19
+ fill = "white"
20
+ />
21
+ < defs >
22
+ < linearGradient
23
+ id = "paint0_linear_1312_15167"
24
+ x1 = "4.22591"
25
+ y1 = "20.1962"
26
+ x2 = "20.6125"
27
+ y2 = "4.23602"
28
+ gradientUnits = "userSpaceOnUse"
29
+ >
30
+ < stop stopColor = "#F71C9D" />
31
+ < stop offset = "1" stopColor = "#FC8926" />
32
+ </ linearGradient >
33
+ </ defs >
34
+ </ svg >
35
+ ) ;
36
+ }
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ import "react-modern-drawer/dist/index.css";
12
12
13
13
import PanelContent from "./PanelContent" ;
14
14
import Header from "../header" ;
15
- import { ForChromeWithoutCodigaText } from "../common/CodigaForChrome" ;
16
15
import { CODIGA_API_TOKEN , API_URL } from "../../lib/constants" ;
16
+ import CodigaIcon from "../../assets/CodigaIcon" ;
17
17
18
18
const httpLink = new HttpLink ( {
19
19
uri : API_URL ,
@@ -53,7 +53,7 @@ const Panel = () => {
53
53
{ client && (
54
54
< ApolloProvider client = { client } >
55
55
< button onClick = { toggleDrawer } className = "codiga-panel-opener" >
56
- < ForChromeWithoutCodigaText />
56
+ < CodigaIcon />
57
57
</ button >
58
58
59
59
< Drawer
Original file line number Diff line number Diff line change @@ -74,13 +74,17 @@ export default function PanelContent({ isOpen }: PanelContentProps) {
74
74
) : (
75
75
< >
76
76
Logged in as{ " " }
77
- < a
78
- target = "_blank"
79
- rel = "noreferrer"
80
- href = { `https://app.codiga.io/hub/user/${ userData . user . accountType } /${ userData . user . username } /assistant` . toLowerCase ( ) }
81
- >
82
- { userData . user . username . toLowerCase ( ) }
83
- </ a >
77
+ { userData . user . hasSlug && userData . user ?. slug ? (
78
+ < a
79
+ target = "_blank"
80
+ rel = "noreferrer"
81
+ href = { `https://app.codiga.io/hub/user/${ userData . user . slug } /assistant` . toLowerCase ( ) }
82
+ >
83
+ { userData . user . username }
84
+ </ a >
85
+ ) : (
86
+ userData . user . username
87
+ ) }
84
88
</ >
85
89
) }
86
90
</ p >
Original file line number Diff line number Diff line change @@ -103,13 +103,17 @@ const PanelSnippetCard = ({
103
103
< div className = "card-subheading" >
104
104
< p className = "card-subheading--group" title = "The snippet owner" >
105
105
< UserIcon />
106
- < a
107
- target = "_blank"
108
- rel = "noreferrer"
109
- href = { `https://app.codiga.io/hub/user/${ snippet . owner . accountType } /${ snippet . owner . username } /assistant` . toLowerCase ( ) }
110
- >
111
- { snippet . owner . username . toLowerCase ( ) }
112
- </ a >
106
+ { snippet . owner . hasSlug && snippet . owner . slug ? (
107
+ < a
108
+ target = "_blank"
109
+ rel = "noreferrer"
110
+ href = { `https://app.codiga.io/hub/user/${ snippet . owner . slug } /assistant` . toLowerCase ( ) }
111
+ >
112
+ { snippet . owner . displayName }
113
+ </ a >
114
+ ) : (
115
+ < > { snippet . owner . displayName } </ >
116
+ ) }
113
117
</ p >
114
118
{ snippet . groups . length > 0 && (
115
119
< p
Original file line number Diff line number Diff line change @@ -73,8 +73,9 @@ export const GET_RECIPES_SEMANTIC = gql`
73
73
downvotes
74
74
upvotes
75
75
owner {
76
- username
77
- accountType
76
+ displayName
77
+ hasSlug
78
+ slug
78
79
}
79
80
groups {
80
81
id
@@ -91,16 +92,18 @@ export const GET_RECIPES_SEMANTIC = gql`
91
92
92
93
export type UserResponse = {
93
94
user : {
94
- accountType : string ;
95
95
username : string ;
96
+ hasSlug : boolean ;
97
+ slug ?: string ;
96
98
} ;
97
99
} ;
98
100
99
101
export const GET_USER = gql `
100
102
query getUser {
101
103
user {
102
- accountType
103
104
username
105
+ hasSlug
106
+ slug
104
107
}
105
108
}
106
109
` ;
Original file line number Diff line number Diff line change @@ -20,8 +20,9 @@ export type AssistantRecipe = {
20
20
isPublic : boolean ;
21
21
isSubscribed : boolean ;
22
22
owner : {
23
- username : string ;
24
- accountType : string ;
23
+ displayName : string ;
24
+ hasSlug : boolean ;
25
+ slug ?: string ;
25
26
} ;
26
27
groups : {
27
28
id : number ;
You can’t perform that action at this time.
0 commit comments