Skip to content

Commit

Permalink
holdingpen: author submission prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
karolina-siemieniuk-morawska committed Jun 11, 2024
1 parent a18d8b7 commit 0012a19
Show file tree
Hide file tree
Showing 42 changed files with 4,917 additions and 91 deletions.
22 changes: 14 additions & 8 deletions ui/src/authors/components/PublicationsSelectAll.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
import React, { useMemo } from 'react';
import { List, Map, Set } from 'immutable';
import { List, Set } from 'immutable';
import { Checkbox } from 'antd';

function getRecordId<T>(result: { getIn: (args: string[], arg?: boolean) => T }) {
function getRecordId<T>(result: {
getIn: (args: string[], arg?: boolean) => T;
}) {
return result.getIn(['metadata', 'control_number']);
}

function getClaimed<T>(result: { getIn: (args: string[], arg?: boolean) => T }) {
function getClaimed<T>(result: {
getIn: (args: string[], arg?: boolean) => T;
}) {
return result.getIn(['metadata', 'curated_relation'], false);
}

function getCanClaim<T>(result: { getIn: (args: string[], arg?: boolean) => T }) {
function getCanClaim<T>(result: {
getIn: (args: string[], arg?: boolean) => T;
}) {
return result.getIn(['metadata', 'can_claim'], false);
}

Expand All @@ -20,10 +26,10 @@ function PublicationsSelectAll<T>({
onChange,
disabled,
}: {
publications: List<any>,
selection: Set<T>,
onChange: Function,
disabled: boolean,
publications: List<any>;
selection: Set<T>;
onChange: Function;
disabled?: boolean;
}) {
const checked = useMemo(
() =>
Expand Down
21 changes: 19 additions & 2 deletions ui/src/common/components/ContentBox/ContentBox.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { Row, Col, Card } from 'antd';
import classNames from 'classnames';

import './ContentBox.less';

Expand All @@ -11,6 +12,8 @@ const ContentBox = ({
children,
subTitle,
className,
fullHeight = true,
smallPadding = true,
}: {
title: string;
leftActions: JSX.Element | JSX.Element[];
Expand All @@ -19,12 +22,26 @@ const ContentBox = ({
children: JSX.Element | JSX.Element[] | any;
subTitle: string;
className: string;
fullHeight?: boolean;
smallPadding?: boolean;
}) => {
return (
children && (
<div className={`__ContentBox__ h-100 ${className}`}>
<div
className={classNames(
'__ContentBox__',
{ 'h-100': fullHeight },
className
)}
>
<Card className="h-100" title={title} loading={loading}>
<div className="pa2">
<div
className={classNames(
{ pa2: smallPadding },
{ pa3: !smallPadding },
className
)}
>
{subTitle && <h3 className="pb1">{subTitle}</h3>}
<div>{children}</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions ui/src/common/components/LinkLikeButton/LinkLikeButton.less
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
& > *:hover {
text-decoration: underline;
}
}
}
}
&.blue {
color: #0050b3;
Expand All @@ -20,7 +20,7 @@
}
}
&.middle {
font-size: 1rem;
font-size: 1.1rem;
}
&.big {
font-size: 1.5rem;
Expand Down
4 changes: 3 additions & 1 deletion ui/src/common/components/LinkLikeButton/LinkLikeButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@ const LinkLikeButton = ({
dataTestId,
color,
disabled,
className,
}: {
children: JSX.Element | string;
onClick: MouseEventHandler<HTMLElement>;
dataTestId: string;
color: string;
disabled: boolean;
className?: string;
}) => (
<Button
disabled={disabled}
type="text"
data-test-id={dataTestId}
onClick={onClick}
className={classNames('__LinkLikeButton__', color, { 'disabled': disabled })}
className={classNames('__LinkLikeButton__', color, { disabled }, className)}
data-testid={dataTestId}
>
{children}
Expand Down
6 changes: 5 additions & 1 deletion ui/src/common/components/Logo/Logo.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
height: 32px;
vertical-align: middle;
}
}
}
.holdingpen .logo {
height: fit-content;
padding: 5px;
}
14 changes: 14 additions & 0 deletions ui/src/common/components/Logo/LogoHoldingpen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';
import { Link } from 'react-router-dom';

import './Logo.less';
import { HOLDINGPEN } from '../../routes';
import { ReactComponent as LogoSvg } from './logo-holdingpen.svg';

const LogoHoldingpen = () => (
<Link className="__Logo__" to={HOLDINGPEN}>
<LogoSvg className="logo" />
</Link>
);

export default LogoHoldingpen;
28 changes: 28 additions & 0 deletions ui/src/common/components/Logo/Vector.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion ui/src/common/components/Logo/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Logo from './Logo';
import LogoHoldingpen from './LogoHoldingpen';

export default Logo;
export { Logo, LogoHoldingpen };
Loading

0 comments on commit 0012a19

Please sign in to comment.