Skip to content

Commit

Permalink
feat: worldcoin badge 🧿 (#462)
Browse files Browse the repository at this point in the history
* feat: add worldcoin badge

* fix: use flex-wrap
  • Loading branch information
bigint committed Aug 18, 2022
1 parent 0120cf6 commit 2a3f700
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
37 changes: 37 additions & 0 deletions src/components/Profile/Badges/Worldcoin.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { Tooltip } from '@components/UI/Tooltip';
import { Profile } from '@generated/types';
import { CheckCircleIcon } from '@heroicons/react/solid';
import React, { FC } from 'react';
import { STATIC_ASSETS } from 'src/constants';

interface Props {
profile: Profile;
}

const Worldcoin: FC<Props> = ({ profile }) => {
if (!profile?.onChainIdentity?.worldcoin?.isHuman) {
return null;
}

return (
<Tooltip
content={
<span className="flex items-center space-x-1">
<span>Worldcoin verified</span>
<CheckCircleIcon className="h-4 w-4" />
</span>
}
placement="top"
>
<img
className="drop-shadow-xl"
height={75}
width={75}
src={`${STATIC_ASSETS}/badges/worldcoin.png`}
alt="Sybil Badge"
/>
</Tooltip>
);
};

export default Worldcoin;
4 changes: 3 additions & 1 deletion src/components/Profile/Badges/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, { FC } from 'react';
import Ens from './Ens';
import ProofOfHumanity from './ProofOfHumanity';
import Sybil from './Sybil';
import Worldcoin from './Worldcoin';

interface Props {
profile: Profile;
Expand All @@ -22,10 +23,11 @@ const Badges: FC<Props> = ({ profile }) => {
return (
<>
<div className="w-full divider" />
<div className="flex flex-row gap-3">
<div className="flex flex-wrap gap-3">
<ProofOfHumanity profile={profile} />
<Ens profile={profile} />
<Sybil profile={profile} />
<Worldcoin profile={profile} />
</div>
</>
);
Expand Down
3 changes: 3 additions & 0 deletions src/components/Profile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ export const PROFILE_QUERY = gql`
ens {
name
}
worldcoin {
isHuman
}
}
stats {
totalFollowers
Expand Down

1 comment on commit 2a3f700

@vercel
Copy link

@vercel vercel bot commented on 2a3f700 Aug 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.