Browse Source

Fixes onboarding modal (#318)

closed-social-glitch-2
kibi! 6 years ago
parent
commit
1fa03e026a
4 changed files with 33 additions and 38 deletions
  1. +4
    -4
      app/javascript/flavours/glitch/features/composer/index.js
  2. +3
    -3
      app/javascript/flavours/glitch/features/composer/options/dropdown/content/index.js
  3. +23
    -25
      app/javascript/flavours/glitch/features/composer/options/index.js
  4. +3
    -6
      app/javascript/flavours/glitch/features/ui/components/onboarding_modal.js

+ 4
- 4
app/javascript/flavours/glitch/features/composer/index.js View File

@ -350,10 +350,10 @@ class Composer extends React.Component {
acceptContentTypes={acceptContentTypes}
advancedOptions={advancedOptions}
disabled={isSubmitting}
full={media.size >= 4 || media.some(
full={media ? media.size >= 4 || media.some(
item => item.get('type') === 'video'
)}
hasMedia={!!media.size}
) : false}
hasMedia={media && !!media.size}
intl={intl}
onChangeAdvancedOption={onChangeAdvancedOption}
onChangeSensitivity={onChangeSensitivity}
@ -369,7 +369,7 @@ class Composer extends React.Component {
spoiler={spoiler}
/>
<ComposerPublisher
countText={`${spoilerText}${countableText(text)}${advancedOptions.get('do_not_federate') ? ' 👁️' : ''}`}
countText={`${spoilerText}${countableText(text)}${advancedOptions && advancedOptions.get('do_not_federate') ? ' 👁️' : ''}`}
disabled={isSubmitting || isUploading || !!text.length && !text.trim().length}
intl={intl}
onSecondarySubmit={handleSecondarySubmit}

+ 3
- 3
app/javascript/flavours/glitch/features/composer/options/dropdown/content/index.js View File

@ -96,7 +96,7 @@ export default class ComposerOptionsDropdownContent extends React.PureComponent
transform: `scale(${scaleX}, ${scaleY})`,
}}
>
{items.map(
{items ? items.map(
({
name,
...rest
@ -110,7 +110,7 @@ export default class ComposerOptionsDropdownContent extends React.PureComponent
options={rest}
/>
)
)}
) : null}
</div>
)}
</Motion>
@ -127,7 +127,7 @@ ComposerOptionsDropdownContent.propTypes = {
name: PropTypes.string.isRequired,
on: PropTypes.bool,
text: PropTypes.node,
})).isRequired,
})),
onChange: PropTypes.func,
onClose: PropTypes.func,
style: PropTypes.object,

+ 23
- 25
app/javascript/flavours/glitch/features/composer/options/index.js View File

@ -292,31 +292,29 @@ export default class ComposerOptions extends React.PureComponent {
onClick={onToggleSpoiler}
title={intl.formatMessage(messages.spoiler)}
/>
{advancedOptions ? (
<Dropdown
active={advancedOptions.some(value => !!value)}
disabled={disabled}
icon='ellipsis-h'
items={[
{
meta: <FormattedMessage {...messages.local_only_long} />,
name: 'do_not_federate',
on: advancedOptions.get('do_not_federate'),
text: <FormattedMessage {...messages.local_only_short} />,
},
{
meta: <FormattedMessage {...messages.threaded_mode_long} />,
name: 'threaded_mode',
on: advancedOptions.get('threaded_mode'),
text: <FormattedMessage {...messages.threaded_mode_short} />,
},
]}
onChange={onChangeAdvancedOption}
onModalClose={onModalClose}
onModalOpen={onModalOpen}
title={intl.formatMessage(messages.advanced_options_icon_title)}
/>
) : null}
<Dropdown
active={advancedOptions && advancedOptions.some(value => !!value)}
disabled={disabled}
icon='ellipsis-h'
items={advancedOptions ? [
{
meta: <FormattedMessage {...messages.local_only_long} />,
name: 'do_not_federate',
on: advancedOptions.get('do_not_federate'),
text: <FormattedMessage {...messages.local_only_short} />,
},
{
meta: <FormattedMessage {...messages.threaded_mode_long} />,
name: 'threaded_mode',
on: advancedOptions.get('threaded_mode'),
text: <FormattedMessage {...messages.threaded_mode_short} />,
},
] : null}
onChange={onChangeAdvancedOption}
onModalClose={onModalClose}
onModalOpen={onModalOpen}
title={intl.formatMessage(messages.advanced_options_icon_title)}
/>
</div>
);
}

+ 3
- 6
app/javascript/flavours/glitch/features/ui/components/onboarding_modal.js View File

@ -38,11 +38,6 @@ PageOne.propTypes = {
domain: PropTypes.string.isRequired,
};
const composerState = {
showSearch: true,
text: 'Awoo! #introductions',
};
const PageTwo = ({ intl, myAccount }) => (
<div className='onboarding-modal__page onboarding-modal__page-two'>
<div className='figure non-interactive'>
@ -50,7 +45,9 @@ const PageTwo = ({ intl, myAccount }) => (
<DrawerAccount account={myAccount} />
<RawComposer
intl={intl}
state={composerState}
privacy='public'
showSearch
text='Awoo! #introductions'
/>
</div>
</div>

Loading…
Cancel
Save