mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-24 20:14:35 -04:00
Sort components (#163)
* Move common components to the `common` directory * rename style directory * Move ForkAwesome to common * Move initializers and restructure application-loader.tsx
This commit is contained in:
parent
f2e273fc40
commit
c949b6950e
125 changed files with 104 additions and 103 deletions
|
@ -1,11 +1,16 @@
|
|||
import moment from 'moment'
|
||||
import { HistoryEntry, HistoryJson, LocatedHistoryEntry, Location } from '../components/landing/pages/history/history'
|
||||
import { SortModeEnum } from '../components/common/sort-button/sort-button'
|
||||
import {
|
||||
HistoryEntry,
|
||||
HistoryEntryOrigin,
|
||||
HistoryJson,
|
||||
LocatedHistoryEntry
|
||||
} from '../components/landing/pages/history/history'
|
||||
import { HistoryToolbarState } from '../components/landing/pages/history/history-toolbar/history-toolbar'
|
||||
import { SortModeEnum } from '../components/sort-button/sort-button'
|
||||
|
||||
export function collectEntries (localEntries: HistoryEntry[], remoteEntries: HistoryEntry[]): LocatedHistoryEntry[] {
|
||||
const locatedLocalEntries = locateEntries(localEntries, Location.LOCAL)
|
||||
const locatedRemoteEntries = locateEntries(remoteEntries, Location.REMOTE)
|
||||
const locatedLocalEntries = locateEntries(localEntries, HistoryEntryOrigin.LOCAL)
|
||||
const locatedRemoteEntries = locateEntries(remoteEntries, HistoryEntryOrigin.REMOTE)
|
||||
return mergeEntryArrays(locatedLocalEntries, locatedRemoteEntries)
|
||||
}
|
||||
|
||||
|
@ -15,7 +20,7 @@ export function sortAndFilterEntries (entries: LocatedHistoryEntry[], toolbarSta
|
|||
return sortEntries(filteredByKeywordSearchEntries, toolbarState)
|
||||
}
|
||||
|
||||
function locateEntries (entries: HistoryEntry[], location: Location): LocatedHistoryEntry[] {
|
||||
function locateEntries (entries: HistoryEntry[], location: HistoryEntryOrigin): LocatedHistoryEntry[] {
|
||||
return entries.map(entry => {
|
||||
return {
|
||||
...entry,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue