Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/credebl/studio into auto…
Browse files Browse the repository at this point in the history
…-endorsement

Signed-off-by: pranalidhanavade <[email protected]>
  • Loading branch information
pranalidhanavade committed Nov 3, 2023
2 parents 02825e0 + 6c7863e commit 66f91ed
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 60 deletions.
96 changes: 72 additions & 24 deletions src/components/AlertComponent/index.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,75 @@
import { Alert } from 'flowbite-react';

export const AlertComponent = ({ message, type, viewButton, onAlertClose, path='' }: { message: string | null, type: string, viewButton?: boolean, path?:string, onAlertClose: () => void }) => {
export const AlertComponent = ({
message,
type,
viewButton,
onAlertClose,
path = '',
}: {
message: string | null;
type: string;
viewButton?: boolean;
path?: string;
onAlertClose: () => void;
}) => {
const getAlertClass = () => {
switch (type) {
case 'warning':
return 'text-yellow-700 bg-yellow-100 border-yellow-500 dark:bg-yellow-200 dark:text-yellow-800';
case 'failure':
return 'text-red-700 bg-red-100 border-red-500 dark:bg-red-200 dark:text-red-800';
case 'success':
return 'text-green-700 bg-green-100 border-green-500 dark:bg-green-200 dark:text-green-800';
default:
return 'text-gray-700 bg-gray-100 border-gray-500 dark:bg-gray-200 dark:text-gray-800';
}
};


return message !== null ? <Alert
className='mb-4'
color={type}
onDismiss={() => onAlertClose()}
>
<span className='flex flex-wrap justify-between items-center'>
<p>
{message}
</p>

{
viewButton
&& <p className='md:w-32 lg:w-48 text-base text-primary-700 text-right'>
return message !== null ? (
<div className="w-full">
<div
className={`flex flex-col gap-2 p-4 text-sm rounded-lg mb-4 ${getAlertClass()}`}
role="alert"
>
<div className="flex items-center w-full" data-testid="flowbite-alert-wrapper">
<div className="w-full">
<div className="flex flex-wrap justify-between items-center w-full">
<div>{message}</div>
{viewButton && (
<div className="md:w-32 lg:w-48 text-base text-primary-700 text-right flex justify-end mr-2">
<a href={path}>View more... </a>
</p>
}

</span>

</Alert>
: <></>
}
</div>
)}
</div>
</div>
<button
aria-label="Dismiss"
className={`-mx-1.5 -my-1.5 ml-auto inline-flex h-8 w-8 rounded-lg p-1.5 ${getAlertClass()}`}
type="button"
onClick={onAlertClose}
>
<svg
stroke="currentColor"
fill="currentColor"
strokeWidth="0"
viewBox="0 0 20 20"
aria-hidden="true"
className={`w-5 h-5 ${getAlertClass()}`}
height="1em"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
fillRule="evenodd"
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
clipRule="evenodd"
></path>
</svg>
</button>
</div>
</div>
</div>
) : (
<></>
);
};
4 changes: 2 additions & 2 deletions src/components/Ecosystem/EcosystemList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const EcosystemList = () => {
if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) {
const ecosystemData = data?.data;
if (ecosystemData) {
console.log(6565, data);

setEcosystemList(ecosystemData);
} else {
await removeFromLocalStorage(storageKeys.ECOSYSTEM_ID);
Expand Down Expand Up @@ -132,7 +132,7 @@ const EcosystemList = () => {
isEcosystemList &&
(isEcosystemData?.isMultiEcosystem || isEcosystemData?.isEcosystemLead),
);
console.log('11', ecosystemList);

return (
<div className="px-4 pt-2">
<div className="mb-2 col-span-full xl:mb-2">
Expand Down
2 changes: 1 addition & 1 deletion src/components/User/UserDashBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const UserDashBoard = () => {
const totalPages = data?.data?.totalPages;
const invitationList = data?.data?.invitations;
if (invitationList.length > 0) {
setMessage(`You have received invitations to join organisation`);
setMessage(`You have received invitations to join organization`);
setViewButton(true);
}
setCurrentPage({
Expand Down
6 changes: 3 additions & 3 deletions src/components/organization/OrganizationsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ const OrganizationsList = () => {
{
organizationsList.map((org) => (
<Card key={org.id} onClick={() => redirectOrgDashboard(org)} className='transform transition duration-500 hover:scale-105 hover:bg-gray-50 cursor-pointer overflow-hidden overflow-ellipsis' style={{ maxHeight: '100%', maxWidth: '100%', overflow: 'auto' }}>
<div className='flex items-center'>
{(org.logoUrl) ? <CustomAvatar size='80' src={org.logoUrl} /> : <CustomAvatar size='80' name={org.name} />}
<div className='flex items-center min-[401px]:flex-nowrap flex-wrap'>
{(org.logoUrl) ? <CustomAvatar className='min-w-[80px]' size='80' src={org.logoUrl} /> : <CustomAvatar size='80' name={org.name} />}

<div className='ml-4'>
<div className='ml-4 w-100/6rem line-clamp-4 '>
<h5 className="text-xl font-bold tracking-tight text-gray-900 dark:text-white">
{org?.name}
</h5>
Expand Down
62 changes: 32 additions & 30 deletions tailwind.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ module.exports = {
textDecoration: ['active'],
width: {
'100/22rem': 'calc(100% - 22rem)',
'100/6rem': 'calc(100% - 6rem)',
},
minWidth: {
kanban: '28rem',
Expand All @@ -108,7 +109,7 @@ module.exports = {
'100/6rem': 'calc(100% - 6rem)',
'100/13rem': 'calc(100% - 13rem)',
'100/10rem': 'calc(100% - 10rem)',
'100/8rem': 'calc(100% - 8rem)'
'100/8rem': 'calc(100% - 8rem)',
},
minHeight: {
'100/18rem': 'calc(100vh - 18rem)',
Expand All @@ -121,37 +122,38 @@ module.exports = {
103: '1.03',
},
},
},

safelist: [
// In Markdown (README…)
'justify-evenly',
'overflow-hidden',
'rounded-md',
safelist: [
// In Markdown (README…)
'justify-evenly',
'overflow-hidden',
'rounded-md',

// From the Hugo Dashboard
'w-64',
'w-1/2',
'rounded-l-lg',
'rounded-r-lg',
'bg-gray-200',
'grid-cols-4',
'grid-cols-7',
'h-6',
'leading-6',
'h-9',
'leading-9',
'shadow-lg',
'bg-opacity-50',
'dark:bg-opacity-80',
// From the Hugo Dashboard
'w-64',
'w-1/2',
'rounded-l-lg',
'rounded-r-lg',
'bg-gray-200',
'grid-cols-4',
'grid-cols-7',
'h-6',
'leading-6',
'h-9',
'leading-9',
'shadow-lg',
'bg-opacity-50',
'dark:bg-opacity-80',

// For Astro one
'grid',
],
// For Astro one
'grid',
],

plugins: [
require('flowbite/plugin'),
require('flowbite-typography'),
require('tailwind-scrollbar')({ nocompatible: true }),
],
plugins: [
require('flowbite/plugin'),
require('flowbite-typography'),
require('tailwind-scrollbar')({ nocompatible: true }),
],
},
};

0 comments on commit 66f91ed

Please sign in to comment.