Skip to content
Open
Show file tree
Hide file tree
Changes from 12 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
2 changes: 1 addition & 1 deletion web-components/src/components/icons/LocationIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

export const LocationIcon = (props: React.SVGProps<SVGSVGElement>) => (
<svg width="24" height="24" fill="none" {...props}>
<svg width="24" height="24" fill="none" viewBox="0 0 24 24" {...props}>
<g clip-path="url(#clip0_2339_7155)">
<path
d="M16 7.17188C16 12.7019 10.0633 16.9629 8.75362 17.8357C8.59668 17.9403 8.40332 17.9403 8.24638 17.8357C6.9367 16.9629 1 12.7019 1 7.17188C1 3.21096 4.35786 0 8.5 0C12.6421 0 16 3.21096 16 7.17188Z"
Expand Down
2 changes: 1 addition & 1 deletion web-components/src/components/icons/PrivateFile.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

export const PrivateFile = (props: React.SVGProps<SVGSVGElement>) => (
<svg width="24" height="24" fill="none" {...props}>
<svg width="24" height="24" fill="none" viewBox="0 0 24 24" {...props}>
<g clip-path="url(#clip0_2339_7111)">
<path
fillRule="evenodd"
Expand Down
2 changes: 1 addition & 1 deletion web-components/src/components/icons/UnlockIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

export const UnlockIcon = (props: React.SVGProps<SVGSVGElement>) => (
<svg width="24" height="24" fill="none" {...props}>
<svg width="24" height="24" fill="none" viewBox="0 0 24 24" {...props}>
<path
d="M11 17C11 16.9138 11.0109 16.8301 11.0314 16.7502C10.4163 16.4091 10 15.7532 10 15C10 13.8954 10.8954 13 12 13C13.1046 13 14 13.8954 14 15C14 15.7532 13.5837 16.4091 12.9686 16.7502C12.9891 16.8301 13 16.9138 13 17V19C13 19.5523 12.5523 20 12 20C11.4477 20 11 19.5523 11 19V17Z"
fill="currentColor"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@ type Props = {
label: string;
icon: JSX.Element;
className?: string;
labelClassName?: string;
};

const Tag = ({ label, icon, className }: Props) => (
const Tag = ({ label, icon, className, labelClassName }: Props) => (
<div
className={cn(
'inline-flex items-center justify-center z-10 p-[4px] rounded-[3px] bg-warning-400',
className,
)}
>
{icon}
<Body className="ml-[3px] text-grey-700 font-bold" size="sm">
<Body
className={cn('ml-[3px] text-grey-700 font-bold', labelClassName)}
size="sm"
>
{label}
</Body>
</div>
Expand Down
5 changes: 5 additions & 0 deletions web-marketplace/src/clients/regen/Regen.Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ const Collaborators = safeLazy(
'../../legacy-pages/Dashboard/MyProjects/ManageProject.Collaborators'
),
);
const DataPosts = safeLazy(
() =>
import('../../legacy-pages/Dashboard/MyProjects/ManageProject.DataPosts'),
);

type RouterProps = {
reactQueryClient: QueryClient;
Expand Down Expand Up @@ -222,6 +226,7 @@ export const getRegenRoutes = ({
>
<Route index element={<Navigate to="collaborators" />} />
<Route path="collaborators" element={<Collaborators />} />
<Route path="data-posts" element={<DataPosts />} />
</Route>
<Route
path="credit-classes"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { msg } from '@lingui/core/macro';

export const DATA_POSTS_TABLE_LABEL = msg`data posts table`;

export const DATA_POSTS_TITLE = msg`Data Posts`;
export const DATA_POSTS_DESCRIPTION = msg`Upload data, provide updates, and anchor your information to the blockchain for full transparency and accountability.`;

export const EDIT_DRAFT_ACTION = msg`Edit Draft`;
export const DELETE_POST_ACTION = msg`Delete Post`;

export const PUBLIC_LABEL = msg`Public`;

/* eslint-disable lingui/no-unlocalized-strings */
/** Column configuration for building sortCallbacks.
* Order must match the headerRows array in DataPostsTable. */
export enum DATA_POSTS_HEADERS {
TITLE = 'title',
DATE_CREATED = 'dateCreated',
AUTHOR = 'author',
PRIVACY = 'privacy',
FILES = 'files',
}

export const DATA_POSTS_COLUMN_MAPPING: Record<
DATA_POSTS_HEADERS,
{ sortKey: string; sortEnabled?: boolean }
> = {
[DATA_POSTS_HEADERS.TITLE]: { sortKey: 'title', sortEnabled: true },
[DATA_POSTS_HEADERS.DATE_CREATED]: {
sortKey: 'createdAt',
sortEnabled: true,
},
[DATA_POSTS_HEADERS.AUTHOR]: { sortKey: 'author', sortEnabled: true },
[DATA_POSTS_HEADERS.PRIVACY]: { sortKey: 'privacy' },
[DATA_POSTS_HEADERS.FILES]: { sortKey: 'filesCount' },
};
/* eslint-enable lingui/no-unlocalized-strings */
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import {
createAscSortHandler,
createDescSortHandler,
} from 'lib/sort/createSortHandler';

import { DataPost } from './DataPostsTable.types';

export type DataPostsSortType =
| 'default'
| 'title-asc'
| 'title-desc'
| 'createdAt-asc'
| 'createdAt-desc'
| 'author-asc'
| 'author-desc';

const asc = createAscSortHandler<DataPost>();
const desc = createDescSortHandler<DataPost>();

export const sortDataPosts = (
posts: DataPost[],
sort: DataPostsSortType,
): DataPost[] => {
switch (sort) {
case 'title-asc':
return posts.sort(asc('title'));
case 'title-desc':
return posts.sort(desc('title'));
case 'createdAt-asc':
return posts.sort(asc('createdAt'));
case 'createdAt-desc':
return posts.sort(desc('createdAt'));
case 'author-asc':
return posts.sort(asc('author'));
case 'author-desc':
return posts.sort(desc('author'));
default:
return posts;
}
};
Loading
Loading