Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Invitations page for org and ecosystem #424

Merged
merged 2 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 31 additions & 62 deletions src/components/EcosystemInvite/EcoInvitationList.tsx
Original file line number Diff line number Diff line change
@@ -1,75 +1,44 @@
interface InvitationProps {
invitationId: string;
ecosytem: [];
}
import type { InvitationProps } from "./EcoSystemReceivedInvitations";
import CustomAvatar from '../Avatar';

const EcoInvitationList = (props: InvitationProps) => {
const { invitationId, ecosytem } = props;

const { name } = ecosytem;
const { name, logoUrl } = ecosytem;

return (
<div className="flex space-x-4">
<svg
width="60"
height="60"
viewBox="0 0 398 398"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clip-path="url(#clip0_3892_5729)">
<path
d="M350.828 117.051V166.651L382.328 143.251L350.828 117.051Z"
fill="#6B7280"
/>
<path
d="M217.922 6.9502C206.822 -2.2498 190.722 -2.3498 179.622 6.8502L166.922 17.6502H230.822L217.922 6.9502Z"
fill="#6B7280"
/>
<path
d="M228.629 282.451C220.029 288.851 209.629 292.351 198.929 292.251C188.229 292.251 177.729 288.851 169.129 282.451L9.82869 163.551V367.451C9.72869 383.951 23.0287 397.451 39.5287 397.551H358.029C374.529 397.451 387.829 383.951 387.729 367.451V163.551L228.629 282.451Z"
fill="#6B7280"
/>
<path
d="M15.3281 143.249L45.8281 165.949V117.949L15.3281 143.249Z"
fill="#6B7280"
/>
<path
d="M65.8281 37.6484V180.848L180.828 266.448C191.528 274.248 206.228 274.248 216.928 266.448L330.828 181.548V37.6484H65.8281ZM136.828 117.648H190.828C196.328 117.648 200.828 122.148 200.828 127.648C200.828 133.148 196.328 137.648 190.828 137.648H136.828C131.328 137.648 126.828 133.148 126.828 127.648C126.828 122.148 131.328 117.648 136.828 117.648ZM260.828 187.648H136.828C131.328 187.648 126.828 183.148 126.828 177.648C126.828 172.148 131.328 167.648 136.828 167.648H260.828C266.328 167.648 270.828 172.148 270.828 177.648C270.828 183.148 266.328 187.648 260.828 187.648Z"
fill="#6B7280"
/>
</g>
<defs>
<clipPath id="clip0_3892_5729">
<rect width="397.55" height="397.55" fill="white" />
</clipPath>
</defs>
</svg>
<div className="flex space-x-2">
<div className="mr-2 border border-gray-200 dark:border-gray-700">
{logoUrl ? (
<CustomAvatar size="60" src={logoUrl} />
) : (
<CustomAvatar size="70" name={name} />
)}
</div>

<div className="flex-1 min-w-0">
<p className="text-base font-semibold text-gray-900 leading-none truncate mb-0.5 dark:text-white">
{name}
</p>
<div className="flex-1 min-w-0">
<p className="text-base font-semibold text-gray-900 leading-none truncate mb-0.5 dark:text-white">
{name}
</p>

<div className="flow-root h-auto">
<ul className="divide-y divide-gray-200 dark:divide-gray-700">
<li className="pt-3 sm:pt-3 overflow-auto">
<div className="items-center space-x-4">
<div className="inline-flex items-center text-base font-normal text-gray-900 dark:text-white">
Role:{' '}
<span
key={invitationId}
className="m-1 bg-blue-100 text-blue-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded dark:bg-blue-900 dark:text-blue-300"
>
Ecosystem Member
</span>
</div>
<div className="flow-root h-auto">
<ul className="divide-y divide-gray-200 dark:divide-gray-700">
<li className="pt-3 sm:pt-3 overflow-auto">
<div className="items-center space-x-4">
<div className="inline-flex items-center text-base font-normal text-gray-900 dark:text-white">
Role:{' '}
<span
key={invitationId}
className="m-1 bg-blue-100 text-blue-800 text-sm font-medium mr-2 px-2.5 py-0.5 rounded dark:bg-blue-900 dark:text-blue-300"
>
Ecosystem Member
</span>
</div>
</li>
</ul>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
);
};

Expand Down
29 changes: 20 additions & 9 deletions src/components/EcosystemInvite/EcoSystemReceivedInvitations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,15 @@ interface IOrgData {
orgName: string
}

export interface InvitationProps {
invitationId: string;
ecosytem: {
name: string;
logoUrl: string;
};
}
export interface EcosystemInvitation {
ecosystem: []
ecosystem: { name: string; logoUrl: string; };
id: string
createDateTime: string
createdBy: number
Expand Down Expand Up @@ -226,14 +233,16 @@ const ReceivedInvitations = () => {
const rejectEnv =
<svg
className="mr-1 h-6 w-6 text-primary-700"
width="20"
height="20"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M6 18L18 6M6 6l12 12"
/>
</svg>
Expand All @@ -243,11 +252,11 @@ const ReceivedInvitations = () => {
width="20"
height="20"
viewBox="0 0 24 24"
stroke-width="2"
strokeWidth="2"
stroke="currentColor"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
strokeLinecap="round"
strokeLinejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" />
<path d="M5 12l5 5l10 -10" />
Expand Down Expand Up @@ -302,7 +311,8 @@ const ReceivedInvitations = () => {
}
id={invitation.id}
color="bg-white"
className='mx-5 mt-5 text-base font-medium text-center text-gray-00 bg-secondary-700 hover:!bg-secondary-800 rounded-lg focus:ring-4 focus:ring-primary-300 sm:w-auto dark:bg-primary-600 dark:focus:ring-primary-800 dark:bg-gray-800"'
className='mr-5 mt-5 text-base font-medium text-center text-gray-00 bg-secondary-700 hover:!bg-secondary-800 rounded-lg focus:ring-4 focus:ring-primary-300 sm:w-auto dark:bg-primary-600 dark:focus:ring-primary-800 dark:bg-gray-800"'
style={{ height: '2.5rem', width: '100%', minWidth: '2rem' }}
>
{rejectEnv}
Reject
Expand All @@ -316,7 +326,8 @@ const ReceivedInvitations = () => {
}
disabled={!invitation?.orgData}
id={invitation.id}
className='mx-5 mt-5 text-base font-medium text-center text-white bg-primary-700 hover:!bg-primary-800 rounded-lg hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 sm:w-auto dark:bg-primary-700 dark:hover:!bg-primary-800 dark:focus:ring-primary-800"'
className='mt-5 text-base font-medium text-center text-white bg-primary-700 hover:!bg-primary-800 rounded-lg hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 sm:w-auto dark:bg-primary-700 dark:hover:!bg-primary-800 dark:focus:ring-primary-800"'
style={{ height: '2.5rem', width: '100%', minWidth: '2rem' }}
>
{acceptEnv}
Accept
Expand Down
Loading