Skip to content

Commit

Permalink
Bump prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
ingraso committed Nov 7, 2018
1 parent fc807a2 commit 283e002
Show file tree
Hide file tree
Showing 31 changed files with 375 additions and 405 deletions.
85 changes: 41 additions & 44 deletions app/components/AnnouncementInLine/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,51 +73,48 @@ class AnnouncementInLine extends Component<Props, State> {

return (
<div>
{actionGrant &&
(event || meeting || group) && (
<div>
{showButton && (
<Button
onClick={this.handleHide}
className={styles.announcementButton}
>
Ny kunngjøring
</Button>
)}
{showLabel && (
<a
onClick={this.handleHide}
className={cx(
button ? styles.labelButton : styles.label,
className
)}
>
{!this.state.sent
? ' Ny kunngjøring '
: ' Kunngjøring sendt '}
</a>
)}
{actionGrant && (event || meeting || group) && (
<div>
{showButton && (
<Button
onClick={this.handleHide}
className={styles.announcementButton}
>
Ny kunngjøring
</Button>
)}
{showLabel && (
<a
onClick={this.handleHide}
className={cx(
button ? styles.labelButton : styles.label,
className
)}
>
{!this.state.sent ? ' Ny kunngjøring ' : ' Kunngjøring sendt '}
</a>
)}

{showForm && (
<Form
onSubmit={handleSubmit(values =>
this.onSubmit(values, event, meeting, group)
)}
>
<Field
name="message"
component={TextArea.Field}
placeholder={placeholder || 'Skriv din kunngjøring her...'}
fieldClassName={styles.field}
className={styles.fieldText}
/>
<Button submit className={styles.button}>
SEND
</Button>
</Form>
)}
</div>
)}
{showForm && (
<Form
onSubmit={handleSubmit(values =>
this.onSubmit(values, event, meeting, group)
)}
>
<Field
name="message"
component={TextArea.Field}
placeholder={placeholder || 'Skriv din kunngjøring her...'}
fieldClassName={styles.field}
className={styles.fieldText}
/>
<Button submit className={styles.button}>
SEND
</Button>
</Form>
)}
</div>
)}
</div>
);
}
Expand Down
11 changes: 5 additions & 6 deletions app/components/ErrorBoundary/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,11 @@ class ErrorBoundary extends React.Component<Props, State> {
<h3>En feil har oppstått</h3>
<p>
Webkom har fått beskjed om feilen.{' '}
{!openReportDialog &&
Raven.lastEventId() && (
<span>
Klikk <b>her</b> for å sende en rapport.
</span>
)}
{!openReportDialog && Raven.lastEventId() && (
<span>
Klikk <b>her</b> for å sende en rapport.
</span>
)}
</p>
</div>
</div>
Expand Down
19 changes: 9 additions & 10 deletions app/components/Feed/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,15 @@ export default class ActivityRenderer extends Component<Props, State> {
(aggregatedActivity.activityCount > activities.length &&
this.state.expanded) ? (
<div className={styles.activityFooter}>
{aggregatedActivity.activities.length > 3 &&
!this.state.expanded && (
<Button
size="small"
submit={false}
onClick={() => this.setState({ expanded: true })}
>
Vis mer
</Button>
)}
{aggregatedActivity.activities.length > 3 && !this.state.expanded && (
<Button
size="small"
submit={false}
onClick={() => this.setState({ expanded: true })}
>
Vis mer
</Button>
)}
{aggregatedActivity.activityCount > activities.length &&
this.state.expanded &&
`og ${aggregatedActivity.activityCount -
Expand Down
2 changes: 1 addition & 1 deletion app/components/Form/ObjectPermissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as React from 'react';
import { SelectInput, CheckBox } from 'app/components/Form';
import Tooltip from 'app/components/Tooltip';

/*
/*
* Usage inside redux-form:
*
* <Fields
Expand Down
2 changes: 1 addition & 1 deletion app/components/Form/legoForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type Props = {
/* Also pick these values based on the keys given on the array
* Should be used when there isn't a visible field for the value,
* at the time of submitting
*
*
* The id is always picked, together with all registered fields
*/
pickAdditionalValues?: Array<string>,
Expand Down
11 changes: 5 additions & 6 deletions app/components/Search/SearchPageResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,11 @@ function SearchResult({ result, onSelect, isSelected }: SearchResultProps) {
</div>
</Flex>

{result.picture &&
result.picture !== 'cover' && (
<Flex className={styles.picture}>
<img src={result.picture} alt="search" role="presentation" />
</Flex>
)}
{result.picture && result.picture !== 'cover' && (
<Flex className={styles.picture}>
<img src={result.picture} alt="search" role="presentation" />
</Flex>
)}
</Flex>
);
}
Expand Down
15 changes: 7 additions & 8 deletions app/components/Search/SearchResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@ const SearchResultItem = ({
style={{ margin: '0px 12px 0px 0px' }}
/>
)}
{!result.profilePicture &&
result.icon && (
<Icon
className={styles.searchResultItemIcon}
name={result.icon}
size={28}
/>
)}
{!result.profilePicture && result.icon && (
<Icon
className={styles.searchResultItemIcon}
name={result.icon}
size={28}
/>
)}
<ul>
<li className={styles.resultTitle}>
<div className={styles.truncateTitle}>{result.title}</div>
Expand Down
44 changes: 21 additions & 23 deletions app/components/Upload/ImageUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,15 @@ export default class ImageUpload extends Component<Props, State> {
backdrop
>
<Fragment>
{inModal &&
!preview && (
<div className={styles.inModalUpload}>
<UploadArea
onDrop={this.onDrop}
multiple={multiple}
image={this.state.img}
/>
</div>
)}
{inModal && !preview && (
<div className={styles.inModalUpload}>
<UploadArea
onDrop={this.onDrop}
multiple={multiple}
image={this.state.img}
/>
</div>
)}
{/* $FlowFixMe */}
{preview && (
<Cropper
Expand All @@ -204,19 +203,18 @@ export default class ImageUpload extends Component<Props, State> {
guides={false}
/>
)}
{multiple &&
!crop && (
<Flex wrap column>
{files.map((file, index) => (
<FilePreview
onRemove={this.onRemove}
file={file}
index={index}
key={index}
/>
))}
</Flex>
)}
{multiple && !crop && (
<Flex wrap column>
{files.map((file, index) => (
<FilePreview
onRemove={this.onRemove}
file={file}
index={index}
key={index}
/>
))}
</Flex>
)}
<Flex
wrap
className={styles.footer}
Expand Down
5 changes: 2 additions & 3 deletions app/reducers/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,8 @@ export const selectRegistrationsFromPools = createSelector(
export const getRegistrationGroups = createSelector(
selectAllRegistrationsForEvent,
registrations => {
const grouped = groupBy(
registrations,
obj => (obj.unregistrationDate.isValid() ? 'unregistered' : 'registered')
const grouped = groupBy(registrations, obj =>
obj.unregistrationDate.isValid() ? 'unregistered' : 'registered'
);
const registered = (grouped['registered'] || []).sort((a, b) =>
a.registrationDate.diff(b.registrationDate)
Expand Down
18 changes: 10 additions & 8 deletions app/reducers/memberships.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ export const selectMembershipsForGroup = createSelector(
if (!group) return [];
const memberships = group.memberships;
if (!memberships) return [];
return memberships.map(m => membershipsById[m]).map(m => {
const userId = m.user;
const user = users[userId];
return {
...m,
user
};
});
return memberships
.map(m => membershipsById[m])
.map(m => {
const userId = m.user;
const user = users[userId];
return {
...m,
user
};
});
}
);
5 changes: 2 additions & 3 deletions app/reducers/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,8 @@ const separateRoles = [
const defaultRole = 'member';

const groupMemberships = memberships =>
groupBy(
sortBy(memberships, 'user.fullName'),
({ role }) => (separateRoles.includes(role) ? role : defaultRole)
groupBy(sortBy(memberships, 'user.fullName'), ({ role }) =>
separateRoles.includes(role) ? role : defaultRole
);

export const selectCommitteeForPages = createSelector(
Expand Down
25 changes: 12 additions & 13 deletions app/routes/admin/email/components/RestrictedMailEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,18 @@ const RestrictedMailEditor = ({
Lag flaskepost
</Button>
)}
{restrictedMailId &&
restrictedMail && (
<a
href={`${
config.serverUrl
}/restricted-mail/${restrictedMailId}/token?auth=${
restrictedMail.tokenQueryParam
}`}
download
>
<Button>Last ned Epost token</Button>
</a>
)}
{restrictedMailId && restrictedMail && (
<a
href={`${
config.serverUrl
}/restricted-mail/${restrictedMailId}/token?auth=${
restrictedMail.tokenQueryParam
}`}
download
>
<Button>Last ned Epost token</Button>
</a>
)}
</Form>
);
};
Expand Down
33 changes: 16 additions & 17 deletions app/routes/announcements/components/AnnouncementsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,22 @@ const AnnouncementsList = ({
createAnnouncement={createAnnouncement}
actionGrant={actionGrant}
/>
{actionGrant.includes('list') &&
actionGrant.includes('delete') && (
<ContentMain>
<h1 className={styles.header}> Mine kunngjøringer </h1>
<Flex column className={styles.list}>
{announcements.map((a, i) => (
<AnnouncementItem
key={i}
announcement={a}
sendAnnouncement={sendAnnouncement}
deleteAnnouncement={deleteAnnouncement}
actionGrant={actionGrant}
/>
))}
</Flex>
</ContentMain>
)}
{actionGrant.includes('list') && actionGrant.includes('delete') && (
<ContentMain>
<h1 className={styles.header}> Mine kunngjøringer </h1>
<Flex column className={styles.list}>
{announcements.map((a, i) => (
<AnnouncementItem
key={i}
announcement={a}
sendAnnouncement={sendAnnouncement}
deleteAnnouncement={deleteAnnouncement}
actionGrant={actionGrant}
/>
))}
</Flex>
</ContentMain>
)}
</Content>
);
};
Expand Down
11 changes: 5 additions & 6 deletions app/routes/company/components/CompaniesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,11 @@ const CompanyItem = ({ company }: Company) => {
</span>
</div>
</Link>
{company.website &&
!company.website.includes('example.com') && (
<a href={company.website} target="_blank">
<div className={styles.website}>{websiteString}</div>
</a>
)}
{company.website && !company.website.includes('example.com') && (
<a href={company.website} target="_blank">
<div className={styles.website}>{websiteString}</div>
</a>
)}
</div>
</div>
);
Expand Down
Loading

0 comments on commit 283e002

Please sign in to comment.