Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed May 6, 2022
1 parent da7d839 commit cc2b223
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 48 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { FunctionComponent } from 'preact'
import { HorizontalSeparator } from '@/Components/Shared/HorizontalSeparator'

const HorizontalLine: FunctionComponent<{ index: number; length: number }> = ({ index, length }) =>
(index < length - 1 ? <HorizontalSeparator classes="my-4" /> : null)
const HorizontalLine: FunctionComponent<{ index: number; length: number }> = ({ index, length }) => {
return index < length - 1 ? <HorizontalSeparator classes="my-4" /> : null
}

export const PreferencesGroup: FunctionComponent = ({ children }) => (
<div className="bg-default border-1 border-solid rounded border-main px-6 py-6 flex flex-col mb-3">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,30 +53,34 @@ export const RemoteHistoryList: FunctionComponent<RemoteHistoryListProps> = obse
ref={remoteHistoryListRef}
>
{isFetchingRemoteHistory && <div className="sk-spinner w-5 h-5 spinner-info"></div>}
{remoteHistory?.map((group) =>
(group.entries && group.entries.length ? (
<Fragment key={group.title}>
<div className="px-3 mt-2.5 mb-1 font-semibold color-text uppercase color-grey-0 select-none">
{group.title}
</div>
{group.entries.map((entry) => (
<HistoryListItem
key={entry.uuid}
isSelected={selectedEntryUuid === entry.uuid}
onClick={() => {
setSelectedEntryUuid(entry.uuid)
fetchAndSetRemoteRevision(entry).catch(console.error)
}}
>
<div className="flex flex-grow items-center justify-between">
<div>{previewHistoryEntryTitle(entry)}</div>
{!application.features.hasMinimumRole(entry.required_role) && <Icon type="premium-feature" />}
</div>
</HistoryListItem>
))}
</Fragment>
) : null),
)}
{remoteHistory?.map((group) => {
if (group.entries && group.entries.length) {
return (
<Fragment key={group.title}>
<div className="px-3 mt-2.5 mb-1 font-semibold color-text uppercase color-grey-0 select-none">
{group.title}
</div>
{group.entries.map((entry) => (
<HistoryListItem
key={entry.uuid}
isSelected={selectedEntryUuid === entry.uuid}
onClick={() => {
setSelectedEntryUuid(entry.uuid)
fetchAndSetRemoteRevision(entry).catch(console.error)
}}
>
<div className="flex flex-grow items-center justify-between">
<div>{previewHistoryEntryTitle(entry)}</div>
{!application.features.hasMinimumRole(entry.required_role) && <Icon type="premium-feature" />}
</div>
</HistoryListItem>
))}
</Fragment>
)
} else {
return null
}
})}
{!remoteHistoryLength && !isFetchingRemoteHistory && (
<div className="color-grey-0 select-none">No remote history found</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,28 +53,32 @@ export const SessionHistoryList: FunctionComponent<Props> = ({
}`}
ref={sessionHistoryListRef}
>
{sessionHistory?.map((group) =>
(group.entries && group.entries.length ? (
<Fragment key={group.title}>
<div className="px-3 mt-2.5 mb-1 font-semibold color-text uppercase color-grey-0 select-none">
{group.title}
</div>
{group.entries.map((entry, index) => (
<HistoryListItem
key={index}
isSelected={selectedItemCreatedAt === entry.payload.created_at}
onClick={() => {
setSelectedItemCreatedAt(entry.payload.created_at)
setSelectedRevision(entry)
setSelectedRemoteEntry(undefined)
}}
>
{entry.previewTitle()}
</HistoryListItem>
))}
</Fragment>
) : null),
)}
{sessionHistory?.map((group) => {
if (group.entries && group.entries.length) {
return (
<Fragment key={group.title}>
<div className="px-3 mt-2.5 mb-1 font-semibold color-text uppercase color-grey-0 select-none">
{group.title}
</div>
{group.entries.map((entry, index) => (
<HistoryListItem
key={index}
isSelected={selectedItemCreatedAt === entry.payload.created_at}
onClick={() => {
setSelectedItemCreatedAt(entry.payload.created_at)
setSelectedRevision(entry)
setSelectedRemoteEntry(undefined)
}}
>
{entry.previewTitle()}
</HistoryListItem>
))}
</Fragment>
)
} else {
return null
}
})}
{!sessionHistoryLength && <div className="color-grey-0 select-none">No session history found</div>}
</div>
)
Expand Down

0 comments on commit cc2b223

Please sign in to comment.