Open History to see the last commit
1import Svg, { Circle, Defs, G, LinearGradient, Path, Rect, Stop } from "react-native-svg";
2import { withUniwind } from "uniwind";
3
4const ThemedSvg = withUniwind(Svg);
5
6export function SourceControlIcon(props: {
7 readonly kind: string;
8 readonly size?: number;
9 readonly color?: string;
10 readonly colorClassName?: string;
11}) {
12 const size = props.size ?? 18;
13
14 switch (props.kind) {
15 case "forgejo":
16 return (
17 <Svg width={size} height={size} viewBox="0 0 212 212">
18 <G transform="translate(6 6)" fill="none">
19 <Path d="M58 168 v-98 a50 50 0 0 1 50-50 h20" stroke="#ff6600" strokeWidth={25} />
20 <Path d="M58 168 v-30 a50 50 0 0 1 50-50 h20" stroke="#d40000" strokeWidth={25} />
21 <Circle cx={142} cy={20} r={18} stroke="#ff6600" strokeWidth={15} />
22 <Circle cx={142} cy={88} r={18} stroke="#d40000" strokeWidth={15} />
23 <Circle cx={58} cy={180} r={18} stroke="#d40000" strokeWidth={15} />
24 </G>
25 </Svg>
26 );
27 case "github":
28 return (
29 <ThemedSvg
30 width={size}
31 height={size}
32 viewBox="0 0 16 16"
33 color={props.color}
34 colorClassName={props.colorClassName}
35 fill="none"
36 >
37 <Path
38 fillRule="evenodd"
39 clipRule="evenodd"
40 d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82A7.68 7.68 0 0 1 8.02 3.86c.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"
41 fill="currentColor"
42 />
43 </ThemedSvg>
44 );
45 case "gitlab":
46 return (
47 <Svg width={size} height={size} viewBox="0 0 32 32" fill="none">
48 <Path
49 d="m31.46 12.78-.04-.12-4.35-11.35A1.14 1.14 0 0 0 25.94.6c-.24 0-.47.1-.66.24-.19.15-.33.36-.39.6l-2.94 9h-11.9l-2.94-9A1.14 1.14 0 0 0 6.07.58a1.15 1.15 0 0 0-1.14.72L.58 12.68l-.05.11a8.1 8.1 0 0 0 2.68 9.34l.02.01.04.03 6.63 4.97 3.28 2.48 2 1.52a1.35 1.35 0 0 0 1.62 0l2-1.52 3.28-2.48 6.67-5h.02a8.09 8.09 0 0 0 2.7-9.36Z"
50 fill="#E24329"
51 />
52 <Path
53 d="m31.46 12.78-.04-.12a14.75 14.75 0 0 0-5.86 2.64l-9.55 7.24 6.09 4.6 6.67-5h.02a8.09 8.09 0 0 0 2.67-9.36Z"
54 fill="#FC6D26"
55 />
56 <Path
57 d="m9.9 27.14 3.28 2.48 2 1.52a1.35 1.35 0 0 0 1.62 0l2-1.52 3.28-2.48-6.1-4.6-6.07 4.6Z"
58 fill="#FCA326"
59 />
60 <Path
61 d="M6.44 15.3a14.71 14.71 0 0 0-5.86-2.63l-.05.12a8.1 8.1 0 0 0 2.68 9.34l.02.01.04.03 6.63 4.97 6.1-4.6-9.56-7.24Z"
62 fill="#FC6D26"
63 />
64 </Svg>
65 );
66 case "azure-devops":
67 // Microsoft Azure DevOps mark via selfhst/icons (CC BY 4.0): https://github.com/selfhst/icons/blob/main/svg/azure-devops.svg
68 return (
69 <Svg width={size} height={size} viewBox="0 0 512 512">
70 <Defs>
71 <LinearGradient
72 id="azure-a"
73 x1="58.027"
74 x2="58.027"
75 y1="356.668"
76 y2="100.668"
77 gradientTransform="matrix(1 0 0 -1 0 514)"
78 gradientUnits="userSpaceOnUse"
79 >
80 <Stop offset="0" stopColor="#163697" />
81 <Stop offset=".276" stopColor="#2052cb" />
82 <Stop offset=".518" stopColor="#2764e7" />
83 <Stop offset=".879" stopColor="#367af2" />
84 </LinearGradient>
85 <LinearGradient
86 id="azure-b"
87 x1="58.027"
88 x2="58.027"
89 y1="351.334"
90 y2="292.668"
91 gradientTransform="matrix(1 0 0 -1 0 514)"
92 gradientUnits="userSpaceOnUse"
93 >
94 <Stop offset="0" stopColor="#102784" />
95 <Stop offset="1" stopColor="#2052cb" stopOpacity="0" />
96 </LinearGradient>
97 <LinearGradient
98 id="azure-c"
99 x1="389.98"
100 x2="107.314"
101 y1="57.935"
102 y2="193.935"
103 gradientTransform="matrix(1 0 0 -1 0 514)"
104 gradientUnits="userSpaceOnUse"
105 >
106 <Stop offset="0" stopColor="#163697" />
107 <Stop offset=".301" stopColor="#2052cb" />
108 <Stop offset=".626" stopColor="#2764e7" />
109 <Stop offset=".926" stopColor="#367af2" />
110 </LinearGradient>
111 <LinearGradient
112 id="azure-d"
113 x1="391.996"
114 x2="341.385"
115 y1="76.552"
116 y2="78.224"
117 gradientTransform="matrix(1 0 0 -1 0 514)"
118 gradientUnits="userSpaceOnUse"
119 >
120 <Stop offset="0" stopColor="#102784" />
121 <Stop offset="1" stopColor="#2052cb" stopOpacity="0" />
122 </LinearGradient>
123 <LinearGradient
124 id="azure-e"
125 x1="442.24"
126 x2="442.24"
127 y1="54.769"
128 y2="419.38"
129 gradientTransform="matrix(1 0 0 -1 0 514)"
130 gradientUnits="userSpaceOnUse"
131 >
132 <Stop offset=".043" stopColor="#2052cb" />
133 <Stop offset=".489" stopColor="#367af2" />
134 <Stop offset=".943" stopColor="#16bbda" />
135 </LinearGradient>
136 <LinearGradient
137 id="azure-f"
138 x1="435.596"
139 x2="425.732"
140 y1="270.413"
141 y2="385.266"
142 gradientTransform="matrix(1 0 0 -1 0 514)"
143 gradientUnits="userSpaceOnUse"
144 >
145 <Stop offset=".134" stopColor="#16bbda" stopOpacity="0" />
146 <Stop offset=".932" stopColor="#6be7a0" stopOpacity=".8629" />
147 </LinearGradient>
148 <LinearGradient
149 id="azure-g"
150 x1="437.081"
151 x2="507.893"
152 y1="204.362"
153 y2="119.081"
154 gradientTransform="matrix(1 0 0 -1 0 514)"
155 gradientUnits="userSpaceOnUse"
156 >
157 <Stop offset="0" stopColor="#2c68e0" stopOpacity="0" />
158 <Stop offset=".898" stopColor="#66c0ff" stopOpacity=".5" />
159 </LinearGradient>
160 <LinearGradient
161 id="azure-h"
162 x1="99.399"
163 x2="352.75"
164 y1="279.26"
165 y2="498.676"
166 gradientTransform="matrix(1 0 0 -1 0 514)"
167 gradientUnits="userSpaceOnUse"
168 >
169 <Stop offset=".005" stopColor="#367af2" />
170 <Stop offset=".507" stopColor="#0fafff" />
171 <Stop offset="1" stopColor="#26cfe8" />
172 </LinearGradient>
173 <LinearGradient
174 id="azure-i"
175 x1="184.342"
176 x2="338.581"
177 y1="356.795"
178 y2="480.642"
179 gradientTransform="matrix(1 0 0 -1 0 514)"
180 gradientUnits="userSpaceOnUse"
181 >
182 <Stop offset=".443" stopColor="#26cfe8" stopOpacity="0" />
183 <Stop offset=".897" stopColor="#6be7a0" stopOpacity=".8629" />
184 </LinearGradient>
185 </Defs>
186 <Path
187 d="M116.1 73.4c-5.8 5.8-13.7 13.8-13.7 22.6v216.4c0 8.9-3.3 17.3-9 23.4s-13.3 9.2-21.1 8.5l-42.7-3.1c-7.9-.5-15-3.9-20.3-9.3-5.7-5.7-9.3-13.7-9.3-22.6V202.7c0-8.9 3.6-16.9 9.4-22.6l2-1.9z"
188 fill="url(#azure-a)"
189 />
190 <Path
191 d="M116.1 73.4c-5.8 5.8-13.7 13.8-13.7 22.6v216.4c0 8.9-3.3 17.3-9 23.4s-13.3 9.2-21.1 8.5l-42.7-3.1c-7.9-.5-15-3.9-20.3-9.3-5.7-5.7-9.3-13.7-9.3-22.6V202.7c0-8.9 3.6-16.9 9.4-22.6l2-1.9z"
192 fill="url(#azure-b)"
193 />
194 <Path
195 d="m500.5 366-128 106.7c-5.5 4.6-12.7 7.4-20.5 7.4q-2.4 0-4.8-.3l-112.5-16.9v27.8c0 11.7-9.6 21.3-21.3 21.3-7.3 0-13.5-3.6-17.5-9.1l-36.2-51.4-5.4-7.6-36.6-51.9-7-10c-2.6-3.5-3.9-7.8-3.9-12.3 0-6 2.5-11.6 6.8-15.7 3.8-3.7 9.1-5.8 14.5-5.8.4 0 1 .1 1.5.1l105.2 7.5L384 366.5l93.7 6.7c.7.1 1.6.1 2.3.1 7.8 0 14.9-2.7 20.5-7.3"
196 fill="url(#azure-c)"
197 />
198 <Path
199 d="m500.5 366-128 106.7c-5.5 4.6-12.7 7.4-20.5 7.4q-2.4 0-4.8-.3l-112.5-16.9v27.8c0 11.7-9.6 21.3-21.3 21.3-7.3 0-13.5-3.6-17.5-9.1l-36.2-51.4-5.4-7.6-36.6-51.9-7-10c-2.6-3.5-3.9-7.8-3.9-12.3 0-6 2.5-11.6 6.8-15.7 3.8-3.7 9.1-5.8 14.5-5.8.4 0 1 .1 1.5.1l105.2 7.5L384 366.5l93.7 6.7c.7.1 1.6.1 2.3.1 7.8 0 14.9-2.7 20.5-7.3"
200 fill="url(#azure-d)"
201 />
202 <Path
203 d="M512 170.7v170.7c0 9.9-4.5 18.8-11.5 24.6l-128 106.7c7-5.9 11.5-14.7 11.5-24.6V175.3c0-16.7 13-30.7 29.8-31.9l63.9-4.6c.7-.1 1.6-.1 2.3-.1 7.8 0 14.9 2.8 20.5 7.4 7 5.8 11.5 14.6 11.5 24.6"
204 fill="url(#azure-e)"
205 />
206 <Path
207 d="M512 170.7v170.7c0 9.9-4.5 18.8-11.5 24.6l-128 106.7c7-5.9 11.5-14.7 11.5-24.6V175.3c0-16.7 13-30.7 29.8-31.9l63.9-4.6c.7-.1 1.6-.1 2.3-.1 7.8 0 14.9 2.8 20.5 7.4 7 5.8 11.5 14.6 11.5 24.6"
208 fill="url(#azure-f)"
209 fillOpacity=".7"
210 />
211 <Path
212 d="M512 170.7v170.7c0 9.9-4.5 18.8-11.5 24.6l-128 106.7c7-5.9 11.5-14.7 11.5-24.6V175.3c0-16.7 13-30.7 29.8-31.9l63.9-4.6c.7-.1 1.6-.1 2.3-.1 7.8 0 14.9 2.8 20.5 7.4 7 5.8 11.5 14.6 11.5 24.6"
213 fill="url(#azure-g)"
214 />
215 <Path
216 d="M384 125.5c0 11.2-8.6 20.5-19.8 21.3-.5 0-1.1.1-1.6.1l-127.9 9.2-132.3 9.1-72.7 5.5c-6.9.4-13.2 3.1-18.2 7.4L116.1 73.4c4.7-4.7 10.9-8 17.8-9.1l100.8-15.1V21.3C234.7 9.6 244.3 0 256 0c5.8 0 11.1 2.3 14.9 6.1l33.4 32.6 16.9 16.5 40.3 39.3 16.1 15.8c4.1 3.9 6.4 9.4 6.4 15.2"
217 fill="url(#azure-h)"
218 />
219 <Path
220 d="M384 125.5c0 11.2-8.6 20.5-19.8 21.3-.5 0-1.1.1-1.6.1l-127.9 9.2-132.3 9.1-72.7 5.5c-6.9.4-13.2 3.1-18.2 7.4L116.1 73.4c4.7-4.7 10.9-8 17.8-9.1l100.8-15.1V21.3C234.7 9.6 244.3 0 256 0c5.8 0 11.1 2.3 14.9 6.1l33.4 32.6 16.9 16.5 40.3 39.3 16.1 15.8c4.1 3.9 6.4 9.4 6.4 15.2"
221 fill="url(#azure-i)"
222 fillOpacity=".5"
223 />
224 </Svg>
225 );
226 case "bitbucket":
227 return (
228 <Svg width={size} height={size} viewBox="8.4 14.39 2481.29 2231.21">
229 <Defs>
230 <LinearGradient
231 id="bitbucket-a"
232 x1="945.1094"
233 y1="1524.8389"
234 x2="944.4923"
235 y2="1524.1893"
236 gradientTransform="matrix(1996.6343 0 0 -1480.3047 -1884485.625 2258195)"
237 >
238 <Stop offset="0.18" stopColor="#0052CC" />
239 <Stop offset="1" stopColor="#2684FF" />
240 </LinearGradient>
241 </Defs>
242 <Path
243 fill="#2684FF"
244 d="M88.92,14.4C45.02,13.83,8.97,48.96,8.41,92.86c-0.06,4.61,0.28,9.22,1.02,13.77l337.48,2048.72 c8.68,51.75,53.26,89.8,105.74,90.24h1619.03c39.38,0.5,73.19-27.9,79.49-66.78l337.49-2071.78c7.03-43.34-22.41-84.17-65.75-91.2 c-4.55-0.74-9.15-1.08-13.76-1.02L88.92,14.4z M1509.99,1495.09H993.24l-139.92-731h781.89L1509.99,1495.09z"
245 />
246 <Path
247 fill="url(#bitbucket-a)"
248 d="M2379.27,763.06h-745.5l-125.12,730.42H992.31l-609.67,723.67c19.32,16.71,43.96,26,69.5,26.21h1618.13 c39.35,0.51,73.14-27.88,79.44-66.72L2379.27,763.06z"
249 />
250 </Svg>
251 );
252 case "gitcafe":
253 return (
254 <Svg width={size} height={size} viewBox="0 0 64 64">
255 <Rect x={4.8} y={4.8} width={54.4} height={54.4} fill="#a78bfa" />
256 </Svg>
257 );
258 default:
259 return null;
260 }
261}