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

Add description field #4165

Open
wants to merge 3 commits into
base: feature/4133-sidebar-form
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.container {
padding-bottom: 30px;
width: 100%;
border-bottom: 1px solid color-mod(var(--temp-grey-blue-7) alpha(15%));
}

.title {
margin-bottom: 16px;
font-size: var(--size-medium-l);
font-weight: var(--weight-bold);
line-height: 24px;
color: var(--dark);
letter-spacing: var(--spacing-medium);
}

.descriptionContainer textarea {
padding: 0;
overflow: hidden;
border: none;
font-size: var(--size-normal);
font-weight: var(--weight-normal);
line-height: 18px;
color: var(--dark);
letter-spacing: 0.1px;
}

.descriptionContainer textarea::placeholder {
font-size: var(--size-normal);
font-style: normal;
color: var(--temp-grey-blue-7);
letter-spacing: 0.1px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const container: string;
export const title: string;
export const descriptionContainer: string;
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { useField } from 'formik';
import React from 'react';
import { defineMessages, FormattedMessage } from 'react-intl';

import { TextareaAutoresize } from '~core/Fields';

import styles from './DescriptionForm.css';

const MSG = defineMessages({
title: {
id: 'dashboard.Incorporation.DescriptionForm.title',
defaultMessage: 'Incorporate this DAO',
},
descriptionPlaceholder: {
id: `dashboard.Incorporation.DescriptionForm.descriptionPlaceholder`,
defaultMessage: 'Add description of why you are incorporating...',
},
});

const displayName = 'dashboard.Incorporation.DescriptionForm';

const DescriptionForm = () => {
const [, { value: description }] = useField('description');

return (
<div className={styles.container}>
<h1 className={styles.title}>
<FormattedMessage {...MSG.title} />
</h1>
<div className={styles.descriptionContainer}>
<TextareaAutoresize
name="description"
placeholder={MSG.descriptionPlaceholder}
label=""
minRows={1}
maxRows={100}
value={description}
elementOnly
/>
</div>
</div>
);
};

DescriptionForm.displayName = displayName;

export default DescriptionForm;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './DescriptionForm';
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,7 @@ const IncorporationForm = ({ colony, sidebarRef }: Props) => (
</FormSection>
<FormSection appearance={{ border: 'bottom' }}>
<div className={styles.textareaWrapper}>
<Textarea
name="description"
label={MSG.descriptionLabel}
maxLength={90}
/>
<Textarea name="purpose" label={MSG.descriptionLabel} maxLength={90} />
</div>
</FormSection>
<Protectors colony={colony} sidebarRef={sidebarRef} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
@value sidebarWidth: 449px;
@value navBarHeight: 70px;

.sidebar {
.main {
display: flex;
justify-content: center;
height: 100%;
}

.mainContainer {
padding-bottom: 50px;
height: 600px;
min-height: 100%;
min-height: calc(100vh - navBarHeight);
width: sidebarWidth;
width: calc(100% - sidebarWidth);
overflow-y: auto;
background-color: var(--grey-blue-3);
background-color: var(--colony-white);
}

.wrapper {
.mainContent {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
width: 100%;
justify-content: space-between;
padding: 54px 85px 70px 40px;
max-width: 500px;
}

.sidebar {
height: 600px;
min-height: calc(100vh - navBarHeight);
width: sidebarWidth;
overflow-y: auto;
background-color: var(--grey-blue-3);
}

.spinnerContainer {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export const sidebarWidth: string;
export const navBarHeight: string;
export const main: string;
export const mainContainer: string;
export const mainContent: string;
export const sidebar: string;
export const wrapper: string;
export const spinnerContainer: string;
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useColonyFromNameQuery } from '~data/generated';
import { getMainClasses } from '~utils/css';
import { SpinnerLoader } from '~core/Preloaders';
import IncorporationForm from '~dashboard/Incorporation/IncorporationForm';
import DescriptionForm from '~dashboard/Incorporation/DescriptionForm';

import { initialValues } from './constants';
import styles from './IncorporationPage.css';
Expand Down Expand Up @@ -44,7 +45,11 @@ const IncorporationPage = () => {
)
)}
</aside>
<div />
<div className={styles.mainContainer}>
<main className={styles.mainContent}>
<DescriptionForm />
</main>
</div>
</div>
)}
</Formik>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ export const initialValues = {
],
mainContact: undefined,
signOption: SignOption.Individual,
description: undefined,
};
1 change: 1 addition & 0 deletions src/modules/pages/components/IncorporationPage/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export interface ValuesType {
protectors?: Protector[];
mainContact?: AnyUser;
signOption: SignOption;
description: string;
}