-
Notifications
You must be signed in to change notification settings - Fork 0
/
DropboxButton.tsx
43 lines (39 loc) · 1.08 KB
/
DropboxButton.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
import * as React from "react";
import { Platform } from "react-native";
import { Button } from "react-native-paper";
import { useHover } from "react-native-web-hooks";
import DropboxIcon from "./DropboxIcon";
// You can import from local files
// or any pure javascript modules available in npm
export default function DropboxButton({ onPress, loading }: any) {
const ref = React.useRef(null);
const isHovered = useHover(ref);
return (
<Button
style={[
{
overflow: "visible",
backgroundColor: "#0061FF",
...Platform.select({
web: { transitionDuration: "150ms" },
default: {},
}),
},
isHovered && { backgroundColor: "#4f90f9" },
]}
loading={loading}
labelStyle={{
...Platform.select({ web: { userSelect: "none" }, default: {} }),
fontWeight: "bold",
fontSize: 16,
marginLeft: 20,
}}
mode="contained"
uppercase={false}
icon={() => <DropboxIcon />}
onPress={onPress}
>
Login With Dropbox
</Button>
);
}