Merge branch 'developers-app-scaffolding' into 'develop'
Developers app scaffolding See merge request soapbox-pub/soapbox-fe!842
This commit is contained in:
commit
383b137bcc
|
@ -0,0 +1,41 @@
|
|||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { injectIntl, FormattedMessage, defineMessages } from 'react-intl';
|
||||
import Column from 'soapbox/features/ui/components/column';
|
||||
import { SimpleForm, TextInput } from 'soapbox/features/forms';
|
||||
|
||||
const messages = defineMessages({
|
||||
heading: { id: 'column.app_create', defaultMessage: 'Create app' },
|
||||
namePlaceholder: { id: 'app_create.name_placeholder', defaultMessage: 'e.g. \'Soapbox\'' },
|
||||
});
|
||||
|
||||
export default @injectIntl
|
||||
class CreateApp extends React.Component {
|
||||
|
||||
static propTypes = {
|
||||
intl: PropTypes.object.isRequired,
|
||||
}
|
||||
|
||||
render() {
|
||||
const { intl } = this.props;
|
||||
|
||||
return (
|
||||
<Column heading={intl.formatMessage(messages.heading)}>
|
||||
<SimpleForm>
|
||||
TODO: This page is incomplete
|
||||
|
||||
<TextInput
|
||||
label={<FormattedMessage id='app_create.name_label' defaultMessage='App name' />}
|
||||
placeholder={intl.formatMessage(messages.namePlaceholder)}
|
||||
required
|
||||
/>
|
||||
<TextInput
|
||||
label={<FormattedMessage id='app_create.website_label' defaultMessage='Website' />}
|
||||
placeholder='https://soapbox.pub'
|
||||
/>
|
||||
</SimpleForm>
|
||||
</Column>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,7 +1,9 @@
|
|||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { injectIntl, defineMessages } from 'react-intl';
|
||||
import { FormattedMessage, injectIntl, defineMessages } from 'react-intl';
|
||||
import { Link } from 'react-router-dom';
|
||||
import Column from '../ui/components/column';
|
||||
import Icon from 'soapbox/components/icon';
|
||||
|
||||
const messages = defineMessages({
|
||||
heading: { id: 'column.developers', defaultMessage: 'Developers' },
|
||||
|
@ -19,8 +21,27 @@ class Developers extends React.Component {
|
|||
|
||||
return (
|
||||
<Column heading={intl.formatMessage(messages.heading)}>
|
||||
<div style={{ padding: '20px 10px', textAlign: 'center' }}>
|
||||
WIP: Developers page
|
||||
<div className='dashcounters'>
|
||||
<div className='dashcounter'>
|
||||
<Link to='/developers/apps/create'>
|
||||
<div className='dashcounter__icon'>
|
||||
<Icon src={require('@tabler/icons/icons/apps.svg')} />
|
||||
</div>
|
||||
<div className='dashcounter__label'>
|
||||
<FormattedMessage id='developers.navigation.app_create_label' defaultMessage='Create an app' />
|
||||
</div>
|
||||
</Link>
|
||||
</div>
|
||||
<div className='dashcounter'>
|
||||
<Link to='/error'>
|
||||
<div className='dashcounter__icon'>
|
||||
<Icon src={require('@tabler/icons/icons/mood-sad.svg')} />
|
||||
</div>
|
||||
<div className='dashcounter__label'>
|
||||
<FormattedMessage id='developers.navigation.intentional_error_label' defaultMessage='Trigger an error' />
|
||||
</div>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</Column>
|
||||
);
|
||||
|
|
|
@ -116,6 +116,7 @@ import {
|
|||
NewStatus,
|
||||
IntentionalError,
|
||||
Developers,
|
||||
CreateApp,
|
||||
} from './util/async-components';
|
||||
|
||||
// Dummy import, to make sure that <Status /> ends up in the application bundle.
|
||||
|
@ -320,8 +321,9 @@ class SwitchingColumnsArea extends React.PureComponent {
|
|||
<WrappedRoute path='/admin/users' page={AdminPage} component={UserIndex} content={children} exact />
|
||||
<WrappedRoute path='/info' page={EmptyPage} component={ServerInfo} content={children} />
|
||||
|
||||
<WrappedRoute path='/error' page={EmptyPage} component={IntentionalError} content={children} />
|
||||
<WrappedRoute path='/developers/apps/create' page={DefaultPage} component={CreateApp} content={children} />
|
||||
<WrappedRoute path='/developers' page={DefaultPage} component={Developers} content={children} />
|
||||
<WrappedRoute path='/error' page={EmptyPage} component={IntentionalError} content={children} />
|
||||
|
||||
<WrappedRoute path='/donate/crypto' publicRoute page={DefaultPage} component={CryptoDonate} content={children} />
|
||||
<WrappedRoute path='/federation_restrictions' publicRoute page={DefaultPage} component={FederationRestrictions} content={children} />
|
||||
|
|
|
@ -429,3 +429,7 @@ export function IntentionalError() {
|
|||
export function Developers() {
|
||||
return import(/* webpackChunkName: "features/developers" */'../../developers');
|
||||
}
|
||||
|
||||
export function CreateApp() {
|
||||
return import(/* webpackChunkName: "features/developers" */'../../developers/apps/create');
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
}
|
||||
|
||||
&__num,
|
||||
&__icon,
|
||||
&__text {
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
|
@ -39,6 +40,20 @@
|
|||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
&__icon {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
.svg-icon {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
|
||||
svg {
|
||||
stroke-width: 1px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__label {
|
||||
font-size: 14px;
|
||||
color: hsla(var(--primary-text-color_hsl), 0.6);
|
||||
|
|
Loading…
Reference in New Issue