-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
2,701 additions
and
3 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
apps/web/src/components/layouts/AppLayout/Header/Rewards/Menu/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use client' | ||
|
||
export function RewardsMenu() { | ||
return ( | ||
<div className="w-[200px] h[500px] bg-blue-500 rounded-md"> | ||
</div> | ||
) | ||
} |
22 changes: 22 additions & 0 deletions
22
apps/web/src/components/layouts/AppLayout/Header/Rewards/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Button } from '@latitude-data/web-ui' | ||
import Popover from 'node_modules/@latitude-data/web-ui/src/ds/atoms/Popover' | ||
|
||
import { RewardsMenu } from './Menu' | ||
|
||
export function RewardsButton() { | ||
return ( | ||
<Popover.Root> | ||
<Popover.Trigger asChild> | ||
<Button size='small' >Rewards</Button> | ||
</Popover.Trigger> | ||
<Popover.Content | ||
side='bottom' | ||
sideOffset={8} | ||
align='center' | ||
className='bg-background rounded-md w-80 p-4 shadow-lg border border-border' | ||
> | ||
<RewardsMenu /> | ||
</Popover.Content> | ||
</Popover.Root> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
DO $$ BEGIN | ||
CREATE TYPE "latitude"."reward_types" AS ENUM('github_star', 'follow', 'post', 'invite', 'referral'); | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "latitude"."claimed_rewards" ( | ||
"id" bigserial PRIMARY KEY NOT NULL, | ||
"workspace_id" bigint NOT NULL, | ||
"creator_id" text, | ||
"reward_type" "latitude"."reward_types" NOT NULL, | ||
"reference" text NOT NULL, | ||
"value" bigint NOT NULL, | ||
"accepted" boolean, | ||
"created_at" timestamp DEFAULT now() NOT NULL, | ||
"updated_at" timestamp DEFAULT now() NOT NULL | ||
); | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "latitude"."claimed_rewards" ADD CONSTRAINT "claimed_rewards_workspace_id_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "latitude"."workspaces"("id") ON DELETE no action ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "latitude"."claimed_rewards" ADD CONSTRAINT "claimed_rewards_creator_id_users_id_fk" FOREIGN KEY ("creator_id") REFERENCES "latitude"."users"("id") ON DELETE set null ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; | ||
--> statement-breakpoint | ||
CREATE INDEX IF NOT EXISTS "claimed_rewards_workspace_id_idx" ON "latitude"."claimed_rewards" USING btree ("workspace_id");--> statement-breakpoint | ||
CREATE UNIQUE INDEX IF NOT EXISTS "workspace_id_reward_type_unique" ON "latitude"."claimed_rewards" USING btree ("workspace_id","reward_type"); |
Oops, something went wrong.