-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from codeformuenster/searchitems-refactor
Searchitems refactor -- centralize all the good stuff
- Loading branch information
Showing
7 changed files
with
140 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
import SearchResultsConstruction from './SearchResultsConstruction'; | ||
import SearchResultsKindergarden from './SearchResultsKindergarden'; | ||
import SearchResultsLunch from './SearchResultsLunch'; | ||
import SearchResultsPlayground from './SearchResultsPlayground'; | ||
import SearchResultsPool from './SearchResultsPool'; | ||
import SearchResultsWc from './SearchResultsWc'; | ||
import SearchResultsWifi from './SearchResultsWifi'; | ||
import SearchResultsWebcam from './SearchResultsWebcam'; | ||
import SearchResultsDefault from './SearchResultsDefault'; | ||
import SearchResultsEvent from './SearchResultsEvent'; | ||
|
||
export interface IMeinItem { | ||
name: string; | ||
icon: string; | ||
color: string; | ||
component: any; | ||
} | ||
|
||
/** | ||
* Class to hold colors, types, names and icons for all our Types | ||
*/ | ||
export abstract class MeinItems { | ||
|
||
public static items: {[id: string]: IMeinItem} = { | ||
construction: { | ||
name: 'Baustelle', | ||
icon: 'mdi-vlc', | ||
color: 'is-danger', | ||
component: SearchResultsConstruction | ||
}, | ||
kindergarden: { | ||
name: 'Kindergarten', | ||
icon: 'mdi-baby-buggy', | ||
color: 'is-primary', | ||
component: SearchResultsKindergarden | ||
}, | ||
lunch: { | ||
name: 'Mittagstisch', | ||
icon: 'mdi-food', | ||
color: 'is-link', | ||
component: SearchResultsLunch | ||
}, | ||
pool: { | ||
name: 'Bad', | ||
icon: 'mdi-pool', | ||
color: 'is-info', | ||
component: SearchResultsPool | ||
}, | ||
playground: { | ||
name: 'Spielplatz', | ||
icon: 'mdi-castle', | ||
color: 'is-warning', | ||
component: SearchResultsPlayground | ||
}, | ||
wc: { | ||
name: 'Toilette', | ||
icon: 'mdi-human-male-female', | ||
color: 'is-light', | ||
component: SearchResultsWc | ||
}, | ||
wifi: { | ||
name: 'WLAN', | ||
icon: 'mdi-wifi', | ||
color: 'is-dark', | ||
component: SearchResultsWifi | ||
}, | ||
webcam: { | ||
name: 'Webcam', | ||
icon: 'mdi-camera', | ||
color: 'is-success', | ||
component: SearchResultsWebcam | ||
}, | ||
event: { | ||
name: 'Termin', | ||
icon: 'mdi-calendar-text', | ||
color: 'is-success', | ||
component: SearchResultsEvent | ||
}, | ||
school: { | ||
name: 'Schule', | ||
icon: 'mdi-school', | ||
color: 'is-light', | ||
component: SearchResultsDefault | ||
}, | ||
sport: { | ||
name: 'Sportstätte', | ||
icon: 'mdi-soccer', | ||
color: 'is-success', | ||
component: SearchResultsDefault | ||
}, | ||
agencies: { | ||
name: 'Amt', | ||
icon: 'mdi-briefcase', | ||
color: 'is-danger', | ||
component: SearchResultsDefault | ||
}, | ||
library: { | ||
name: 'Bücherei', | ||
icon: 'mdi-book', | ||
color: 'is-warning', | ||
component: SearchResultsDefault | ||
} | ||
}; | ||
|
||
public static getItem(key: string): IMeinItem { | ||
return MeinItems.items[key] || { | ||
name: key, | ||
icon: key, | ||
color: key, | ||
component: SearchResultsDefault | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters