-
Notifications
You must be signed in to change notification settings - Fork 84
/
github.tsx
79 lines (72 loc) · 2.64 KB
/
github.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/* Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved.
*
* This software is licensed under the Apache License, Version 2.0 (the
* "License") as published by the Apache Software Foundation.
*
* You may not use this file except in compliance with the License. You may
* obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
/*
* Imports.
*/
import { isTest } from "../../../utils";
import type { BuiltInProviderConfig } from "./types";
import Provider from ".";
/*
* Class.
*/
export default class Github extends Provider {
/*
* Static Attributes.
*/
private static instance?: Github;
/*
* Constructor.
*/
constructor(config?: BuiltInProviderConfig) {
super({
id: "github",
name: "GitHub",
...config,
});
}
getLogo = (): JSX.Element => {
return (
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="17.556" viewBox="0 0 18 17.556">
<path
fill="#000"
fillRule="evenodd"
d="M145.319 107.44a9 9 0 0 0-2.844 17.54c.45.082.614-.2.614-.434 0-.214-.008-.78-.012-1.531-2.5.544-3.032-1.206-3.032-1.206a2.384 2.384 0 0 0-1-1.317c-.817-.559.062-.547.062-.547a1.89 1.89 0 0 1 1.378.927 1.916 1.916 0 0 0 2.619.748 1.924 1.924 0 0 1 .571-1.2c-2-.227-4.1-1-4.1-4.448a3.479 3.479 0 0 1 .927-2.415 3.233 3.233 0 0 1 .088-2.382s.755-.242 2.475.923a8.535 8.535 0 0 1 4.506 0c1.718-1.165 2.472-.923 2.472-.923a3.234 3.234 0 0 1 .09 2.382 3.473 3.473 0 0 1 .925 2.415c0 3.458-2.1 4.218-4.11 4.441a2.149 2.149 0 0 1 .611 1.667c0 1.2-.011 2.174-.011 2.469 0 .24.162.52.619.433a9 9 0 0 0-2.851-17.539z"
transform="translate(-136.32 -107.44)"
/>
</svg>
);
};
/*
* Static Methods
*/
static init(config?: BuiltInProviderConfig): Provider {
if (Github.instance !== undefined) {
console.warn("Github Provider was already initialized");
return Github.instance;
}
Github.instance = new Github(config);
return Github.instance;
}
/*
* Tests methods.
*/
static reset(): void {
if (!isTest()) {
return;
}
Github.instance = undefined;
return;
}
}