Skip to content

Commit

Permalink
fix(wip): integrate frontend sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Nabhag8848 committed Aug 9, 2024
1 parent c0b554a commit 2c11e7c
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 14 deletions.
48 changes: 48 additions & 0 deletions packages/revert-next/app/dashboard/onboarding/FrontendSdk.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { Icons } from '@revertdotdev/icons';
import { inter } from '@revertdotdev/fonts';
import { cn } from '@revertdotdev/utils';
import { useState } from 'react';
import Image from 'next/image';

export function FrontendSdk() {
const [customPreferenceView, setCustomPreferenceView] = useState<boolean>(false);

return (
<div>
<div className="mb-8 flex justify-between items-center">
<div>
<h1 className={`${inter.className} mb-2 text-xl font-bold`}>Integrate frontend SDK</h1>
<p className="text-gray-50">Your Api Requests are authenticated using Api keys in the header</p>
</div>
</div>
<div className={cn('flex gap-4 mb-4')}>
<button
className={cn('border border-gray-25 rounded-xl w-6/12 p-4 revert-focus-outline', {
'gradient-border': !customPreferenceView,
})}
onClick={() => (customPreferenceView ? setCustomPreferenceView(false) : null)}
>
<div className="flex items-start justify-start gap-3">
<Icons.react className="size-6 stroke-1" />
<div className="flex flex-col gap-1">
<h4 className="text-left text-gray-50/70 text-base font-semibold">React</h4>
</div>
</div>
</button>
<button
className={cn('border border-gray-25 rounded-xl w-6/12 p-4 revert-focus-outline', {
'gradient-border': customPreferenceView,
})}
onClick={() => (!customPreferenceView ? setCustomPreferenceView(true) : null)}
>
<div className="flex items-start justify-start gap-3">
<Image src="/vuejs-icon.svg" alt="Vuejs" height={24} width={24} />
<div className="flex flex-col gap-1">
<h4 className="text-left text-gray-50/70 text-base font-bold">Vue.js</h4>
</div>
</div>
</button>
</div>
</div>
);
}
6 changes: 3 additions & 3 deletions packages/revert-next/app/dashboard/onboarding/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { AccountResponseSchema } from '@revertdotdev/types/schemas/accountSchema
import { tp_id } from '@revertdotdev/types/schemas/commonSchema';
import { cn } from '@revertdotdev/utils';
import { Dispatch, SetStateAction, useState } from 'react';
import { FrontendSdk } from './FrontendSdk';

type MainProps = {
step: number;
Expand All @@ -17,7 +18,7 @@ function Main({ step, account, userId, setStep }: MainProps) {

const app = apps.find((app) => app.tp_id == selectedApp);
return (
<main className="overflow-scroll">
<main className="overflow-y-scroll pt-12">
{step == 0 && (
<OnboardingApplicationCards
apps={apps}
Expand Down Expand Up @@ -46,8 +47,7 @@ function Main({ step, account, userId, setStep }: MainProps) {
</div>
</div>
)}
{step == 2 && <div>Step 3</div>}
{step == 3 && <div>Step 4</div>}
{step == 2 && <FrontendSdk />}
</main>
);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/revert-next/app/dashboard/onboarding/Onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ function Onboarding({ account, userId }: OnboardingProps) {
const [step, setStep] = useState(0);

return (
<div className="grid grid-cols-[auto,1fr] gap-4 overflow-auto">
<div className="flex flex-col h-[50vh] justify-around w-60 overflow-hidden">
<div className="grid grid-cols-[auto,1fr] gap-4">
<div className="flex flex-col h-[50vh] justify-around w-60">
<Steps currentStep={step} setStep={setStep} />
<ReachOutLinks />
</div>
Expand Down
16 changes: 9 additions & 7 deletions packages/revert-next/app/dashboard/onboarding/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ export default async function Page() {
}

return (
<div className="relative">
<div className="w-auto h-44 border border-none rounded-lg bg-gradient-to-br from-accent-500 to-shade-800 mb-4">
<div className="absolute ml-8 mt-20">
<h1 className={`${inter.className} mb-2 text-xl md:text-2xl font-bold`}>
Welcome to Revert, {user.firstName}
</h1>
<p>Complete these following steps to get your integration up and running</p>
<div>
<div className="relative">
<div className="w-auto h-44 border border-none rounded-lg bg-gradient-to-br from-accent-500 to-shade-800 mb-4">
<div className="absolute ml-8 mt-20">
<h1 className={`${inter.className} mb-2 text-xl md:text-2xl font-bold`}>
Welcome to Revert, {user.firstName}
</h1>
<p>Complete these following steps to get your integration up and running</p>
</div>
</div>
</div>
<Onboarding account={account} userId={user.id} />
Expand Down
8 changes: 8 additions & 0 deletions packages/revert-next/components/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,14 @@ export const Icons = {
<line x1="16" x2="16" y1="2" y2="4" />
</svg>
),
react: (props: IconProps) => (
<svg height="2500" viewBox="175.7 78 490.6 436.9" width="2194" xmlns="http://www.w3.org/2000/svg" {...props}>
<g fill="#61dafb">
<path d="m666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9v-22.3c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6v-22.3c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zm-101.4 106.7c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24s9.5 15.8 14.4 23.4zm73.9-208.1c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6s22.9-35.6 58.3-50.6c8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zm53.8 142.9c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6z" />
<circle cx="420.9" cy="296.5" r="45.7" />
</g>
</svg>
),
};

export {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export function AppSettings({ app, keys, isOnboarding = false }: AppSettingsProp
return (
<div className={cn('max-w-[64rem] xl:max-w-[64%]', { 'xl:max-w-max': isOnboarding })}>
{isOnboarding && (
<div className="mb-8 flex justify-between items-center mt-12">
<div className="mb-8 flex justify-between items-center">
<div>
<h1 className={`${inter.className} mb-2 text-xl font-bold`}>Setup App Credentials</h1>
<p className="text-gray-50">Your Api Requests are authenticated using Api keys in the header</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function OnboardingApplicationCards({
}

return (
<div className="mt-12">
<div>
<div className="mb-8 flex justify-between items-center">
<div>
<h1 className={`${inter.className} mb-2 text-xl font-bold`}>
Expand Down
64 changes: 64 additions & 0 deletions packages/revert-next/public/vuejs-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2c11e7c

Please sign in to comment.