-
Notifications
You must be signed in to change notification settings - Fork 81
/
facebook.tsx
74 lines (67 loc) · 2.2 KB
/
facebook.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
/* 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 Facebook extends Provider {
/*
* Static Attributes.
*/
private static instance?: Facebook;
/*
* Constructor.
*/
constructor(config?: BuiltInProviderConfig) {
super({
id: "facebook",
name: "Facebook",
...config,
});
}
getLogo = (): JSX.Element => {
return (
<svg fill="#1777F2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="24px" height="24px">
<path d="M15,3C8.373,3,3,8.373,3,15c0,6.016,4.432,10.984,10.206,11.852V18.18h-2.969v-3.154h2.969v-2.099c0-3.475,1.693-5,4.581-5 c1.383,0,2.115,0.103,2.461,0.149v2.753h-1.97c-1.226,0-1.654,1.163-1.654,2.473v1.724h3.593L19.73,18.18h-3.106v8.697 C22.481,26.083,27,21.075,27,15C27,8.373,21.627,3,15,3z" />
</svg>
);
};
/*
* Static Methods
*/
static init(config?: BuiltInProviderConfig): Provider {
if (Facebook.instance !== undefined) {
console.warn("Facebook Provider was already initialized");
return Facebook.instance;
}
Facebook.instance = new Facebook(config);
return Facebook.instance;
}
/*
* Tests methods.
*/
static reset(): void {
if (!isTest()) {
return;
}
Facebook.instance = undefined;
return;
}
}