-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgreetUser.js
More file actions
73 lines (70 loc) · 2.25 KB
/
greetUser.js
File metadata and controls
73 lines (70 loc) · 2.25 KB
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
import { connect } from "react-redux";
import Link from "next/link";
function GreetUser(props) {
return props.selectedAddress ? (
<div>
{props.user.username ? (
<div className="flex">
<div className="text-xl ml-4">
<Link href={"/" + props.user.username} className="link link-primary no-underline">
{props.user.name ? props.user.name : props.user.username}
</Link>
</div>
</div>
) : (
<div>
{props.user.creator ? (
<div>
<div className="bg-box-grad-tl bg-base-200 p-4 rounded-md">
<div>
<div className="text-lg">Claim your username</div>
<div className="text-xs mt-2 text-type-secondary">
Your profile has been upgraded, now username can be used
to refer your repositories
</div>
</div>
<div className="mt-4">
<Link
href={"/" + props.selectedAddress}
className="btn btn-accent btn-wide btn-sm"
>
Edit Profile
</Link>
</div>
</div>
</div>
) : (
<div>
<div className="bg-box-grad-tl bg-base-200 p-4 rounded-md">
<div>
<div className="text-lg">Create your profile</div>
<div className="text-xs mt-2 text-type-secondary">
A profile is required to publish and interact with Gitopia
repositories
</div>
</div>
<div className="mt-4">
<Link
href={"/login?step=6"}
className="btn btn-primary btn-wide btn-sm"
>
Create Profile
</Link>
</div>
</div>
</div>
)}
</div>
)}
</div>
) : (
<div></div>
);
}
const mapStateToProps = (state) => {
return {
selectedAddress: state.wallet.selectedAddress,
user: state.user,
};
};
export default connect(mapStateToProps, {})(GreetUser);