-
Notifications
You must be signed in to change notification settings - Fork 456
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
1 parent
f3258ec
commit e44cf69
Showing
24 changed files
with
452 additions
and
144 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
prisma/migrations/20241031043344_username_remove/migration.sql
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,11 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `username` on the `User` table. All the data in the column will be lost. | ||
*/ | ||
-- DropIndex | ||
DROP INDEX "User_username_key"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "User" DROP COLUMN "username"; |
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 |
---|---|---|
|
@@ -12,21 +12,19 @@ import bcrypt from 'bcryptjs'; | |
const prisma = new PrismaClient(); | ||
|
||
const users = [ | ||
{ id: '1', name: 'Jack', email: '[email protected]', username: 'jackcoder', role: Role.USER }, | ||
{ id: '1', name: 'Jack', email: '[email protected]', role: Role.USER }, | ||
{ | ||
id: '2', | ||
name: 'Admin', | ||
email: '[email protected]', | ||
role: Role.ADMIN, | ||
onBoard: true, | ||
username: 'admincoder', | ||
}, | ||
{ | ||
id: '3', | ||
name: 'Hr', | ||
email: '[email protected]', | ||
role: Role.HR, | ||
username: 'hrcoder', | ||
}, | ||
]; | ||
|
||
|
@@ -334,7 +332,6 @@ async function seedUsers() { | |
password: hashedPassword, | ||
role: u.role || Role.USER, | ||
emailVerified: new Date(), | ||
username: u.username, | ||
}, | ||
}); | ||
console.log(`User created or updated: ${u.email}`); | ||
|
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
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
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
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
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,88 @@ | ||
import React from 'react'; | ||
import { Button } from '@/components/ui/button'; | ||
import { | ||
Dialog, | ||
DialogContent, | ||
DialogHeader, | ||
DialogTitle, | ||
DialogTrigger, | ||
} from '@/components/ui/dialog'; | ||
import { Twitter, Linkedin, Share2, Copy } from 'lucide-react'; | ||
import { useToast } from '../ui/use-toast'; | ||
|
||
interface ShareOption { | ||
name: string; | ||
icon: React.ReactNode; | ||
shareFunction: () => void; | ||
} | ||
|
||
export const ProfileShareDialog = () => { | ||
const { toast } = useToast(); | ||
|
||
const shareOptions: ShareOption[] = [ | ||
{ | ||
name: 'Twitter', | ||
icon: <Twitter className="h-5 w-5" />, | ||
shareFunction: () => { | ||
const text = encodeURIComponent( | ||
`Check out my new profile at 100xdevs Job-Board: ${window.location.href}` | ||
); | ||
window.open(`https://twitter.com/intent/tweet?text=${text}`, '_blank'); | ||
}, | ||
}, | ||
{ | ||
name: 'LinkedIn', | ||
icon: <Linkedin className="h-5 w-5" />, | ||
shareFunction: () => { | ||
const url = encodeURIComponent(window.location.href); | ||
const title = encodeURIComponent('My New Profile'); | ||
const summary = encodeURIComponent( | ||
`Excited to share my new profile on 100xdevs Job-Board! Check it out here: ${url} #JobSearch #Hiring #OpenToWork` | ||
); | ||
window.open( | ||
`https://www.linkedin.com/sharing/share-offsite/?url=${url}&title=${title}&summary=${summary}`, | ||
'_blank' | ||
); | ||
}, | ||
}, | ||
{ | ||
name: 'Copy', | ||
icon: <Copy className="h-5 w-5" />, | ||
shareFunction: () => { | ||
window.navigator.clipboard.writeText(window.location.href); | ||
toast({ | ||
variant: 'success', | ||
description: 'Successfully copied the Profile Url.', | ||
}); | ||
}, | ||
}, | ||
]; | ||
|
||
return ( | ||
<Dialog> | ||
<DialogTrigger asChild> | ||
<Button variant={'outline'} className="px-3 py-2 rounded-sm"> | ||
<Share2 height={16} width={16} /> | ||
</Button> | ||
</DialogTrigger> | ||
<DialogContent className="sm:max-w-md"> | ||
<DialogHeader> | ||
<DialogTitle>Share Job</DialogTitle> | ||
</DialogHeader> | ||
<div className="flex flex-col space-y-4"> | ||
{shareOptions.map((option) => ( | ||
<Button | ||
key={option.name} | ||
variant="outline" | ||
className="w-full justify-start gap-2" | ||
onClick={() => option.shareFunction()} | ||
> | ||
{option.icon} | ||
{option.name === 'Copy' ? 'Copy Url' : `Share on ${option.name}`} | ||
</Button> | ||
))} | ||
</div> | ||
</DialogContent> | ||
</Dialog> | ||
); | ||
}; |
Oops, something went wrong.