Skip to content

Commit b616d7a

Browse files
hannesmcmanhawkrives
authored andcommitted
add safety view
1 parent 0210ac4 commit b616d7a

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

source/views/home/home.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {allViews} from '../views'
1313
import {Column} from '@frogpond/layout'
1414
import {partitionByIndex} from '../../lib/partition-by-index'
1515
import {HomeScreenButton, CELL_MARGIN} from './button'
16-
import {trackedOpenUrl} from '@frogpond/open-url'
16+
import {trackedOpenUrl, openUrlInBrowser} from '@frogpond/open-url'
1717
import {EditHomeButton, OpenSettingsButton} from '@frogpond/navigation-buttons'
1818
import {UnofficialAppNotice} from './notice'
1919

@@ -60,6 +60,8 @@ function HomePage({navigation, order, inactiveViews, views = allViews}: Props) {
6060
onPress={() => {
6161
if (view.type === 'url') {
6262
return trackedOpenUrl({url: view.url, id: view.view})
63+
} else if (view.type === 'browser-url') {
64+
return openUrlInBrowser({url: view.url, id: view.view})
6365
} else {
6466
return navigation.navigate(view.view)
6567
}

source/views/views.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ export type ViewType =
2222
tint: string,
2323
gradient?: [string, string],
2424
}
25+
| {
26+
type: 'browser-url',
27+
view: string,
28+
url: string,
29+
title: string,
30+
icon: string,
31+
foreground: 'light' | 'dark',
32+
tint: string,
33+
gradient?: [string, string],
34+
}
2535

2636
export const allViews: ViewType[] = [
2737
{
@@ -162,6 +172,16 @@ export const allViews: ViewType[] = [
162172
tint: c.periwinkle,
163173
gradient: c.tealToSeafoam,
164174
},
175+
{
176+
type: 'browser-url',
177+
url: 'https://wp.stolaf.edu/safety-committee/report-a-safety-concern-2/',
178+
view: 'SafetyView',
179+
title: 'Safety Concerns',
180+
icon: 'warning',
181+
foreground: 'light',
182+
tint: c.periwinkle,
183+
gradient: c.tealToSeafoam,
184+
},
165185
]
166186

167187
export const allViewNames = allViews.map(v => v.view)

0 commit comments

Comments
 (0)