Skip to content
This repository was archived by the owner on Jul 19, 2022. It is now read-only.

Commit 22866ce

Browse files
committed
Move modals out of UnisonShare.App
Refactor modals out of UnisonShare.App into UnisonShare.AppModal. This leaves UnisonLocal alone, though that could also benefit from a similar refactor. Also change the webpack config and npm start scripts to allow for starting the UnisonLocal and UnisonShare apps separately.
1 parent 8440516 commit 22866ce

File tree

9 files changed

+433
-253
lines changed

9 files changed

+433
-253
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Running Development Server
1515

1616
2. Make sure the latest dependencies are installed with by running `npm install`
1717

18-
3. Start the development server, run: `API_URL="<API URL FROM UCM>" npm start`
18+
3. Start the Unison Share dev server with: `API_URL="<API URL FROM UCM>" npm run start:unisonShare` or the Unison Local dev server with: `API_URL="<API URL FROM UCM>" npm run start:unisonLocal`
1919

2020
4. Visit `http://localhost:1234` in a browser.
2121

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
"build": "webpack --mode production --config webpack.prod.js",
1111
"clean": "rm -rf dist",
1212
"start": "webpack serve --mode development --port 1234 --config webpack.dev.js",
13+
"start:unisonLocal": "webpack serve --mode development --port 1234 --config webpack.unisonLocal.dev.js",
14+
"start:unisonShare": "webpack serve --mode development --port 1234 --config webpack.unisonShare.dev.js",
1315
"test": "elm-test",
1416
"review": "elm-review"
1517
},

src/UI/Button.elm

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module UI.Button exposing
66
, contained
77
, danger
88
, default
9+
, github
910
, icon
1011
, iconThenLabel
1112
, large
@@ -310,6 +311,17 @@ withSize size button_ =
310311

311312

312313

314+
-- COMMON INSTANCES
315+
316+
317+
github : String -> Button msg
318+
github repo =
319+
linkIconThenLabel ("https://github.com/" ++ repo) I.github repo
320+
|> small
321+
|> contained
322+
323+
324+
313325
-- INTERNAL
314326

315327

src/UnisonLocal/App.elm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ viewMainSidebar model =
572572
(List.map
573573
(\( l, c ) -> Click.view [] [ text l ] c)
574574
subMenu
575-
++ [ a [ class "show-help", onClick (ShowModal HelpModal) ]
575+
++ [ a [ class "show-keyboard-shortcuts", onClick (ShowModal HelpModal) ]
576576
[ text "Keyboard Shortcuts"
577577
, KeyboardShortcut.view model.keyboardShortcut (KeyboardShortcut.single QuestionMark)
578578
]
@@ -584,7 +584,7 @@ viewMainSidebar model =
584584
[ unisonSubmenu
585585
, Tooltip.tooltip
586586
(a
587-
[ class "show-help-collapsed", onClick (ShowModal HelpModal) ]
587+
[ class "show-keyboard-shortcuts-collapsed", onClick (ShowModal HelpModal) ]
588588
[ KeyboardShortcut.view model.keyboardShortcut (KeyboardShortcut.single QuestionMark)
589589
]
590590
)

0 commit comments

Comments
 (0)