Skip to content

Commit

Permalink
🎨 RW-95: created basic first login component
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikssxed committed Apr 11, 2024
1 parent 2074187 commit 324ce8a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion marketplace-app/src/modules/auth/LogIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const LogIn = () => {
},
onSuccess(data) {
queryClient.removeQueries();
navigate('/', { state: { email: data.data.is_first_login } });
navigate('/', { state: { firstLogin: data.data.is_first_login } });
},
}
);
Expand Down
3 changes: 3 additions & 0 deletions marketplace-app/src/modules/user/FirstLogin.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const FirstLogin = () => {
return <div>FirstLogin</div>;
};
8 changes: 4 additions & 4 deletions marketplace-app/src/modules/user/User.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export const User: FC<Props> = ({ user }) => {
<UserIcon overrideColors className='w-9 h-9 fill-neutral-400' />
</div>
<div>
<h3 className='text-sm font-semibold'>{user.sponsor.name}</h3>
<h3 className='text-sm font-semibold'>{user.sponsor?.name}</h3>
<p className='text-neutral-400 text-xs font-normal'>
{user.sponsor.type === 'COMPANY'
{user.sponsor?.type === 'COMPANY'
? fmtMsg('company')
: fmtMsg('individual')}
</p>
Expand Down Expand Up @@ -62,9 +62,9 @@ export const User: FC<Props> = ({ user }) => {
<div className='px-6 py-5 bg-zinc-100 rounded-t-3xl cursor-default flex items-center gap-2 dark:bg-neutral-900'>
<UserIcon overrideColors className='w-9 h-9 fill-neutral-400' />
<div>
<h3 className='text-sm font-semibold'>{user.sponsor.name}</h3>
<h3 className='text-sm font-semibold'>{user.sponsor?.name}</h3>
<p className='text-neutral-400 text-xs font-normal'>
{user.sponsor.type === 'COMPANY'
{user.sponsor?.type === 'COMPANY'
? fmtMsg('company')
: fmtMsg('individual')}
</p>
Expand Down
1 change: 1 addition & 0 deletions marketplace-app/src/modules/user/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './FirstLogin';
export * from './TopUsersSection';
export * from './User';
export * from './UsersList';
Expand Down
7 changes: 6 additions & 1 deletion marketplace-app/src/pages/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import { NFTSection } from 'modules/nft';
import { TopUsersSection, useUser } from 'modules/user';
import { FirstLogin, TopUsersSection, useUser } from 'modules/user';
import { useLocation } from 'react-router-dom';

export const Home = () => {
useUser();

const location = useLocation();
const firstLogin: boolean | undefined = location.state?.firstLogin;

return (
<>
<NFTSection />
<TopUsersSection />
{firstLogin && <FirstLogin />}
</>
);
};

0 comments on commit 324ce8a

Please sign in to comment.