From 3ec18480a4d0931ac8a9645e490bced4e273cdee Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 3 May 2017 14:38:12 -0400 Subject: [PATCH 01/13] Flesh out the blank slate --- app/src/ui/blank-slate/blank-slate.tsx | 44 ++++++++++++++++++++++++++ app/src/ui/blank-slate/index.ts | 1 + 2 files changed, 45 insertions(+) create mode 100644 app/src/ui/blank-slate/blank-slate.tsx create mode 100644 app/src/ui/blank-slate/index.ts diff --git a/app/src/ui/blank-slate/blank-slate.tsx b/app/src/ui/blank-slate/blank-slate.tsx new file mode 100644 index 00000000000..9341b30dad8 --- /dev/null +++ b/app/src/ui/blank-slate/blank-slate.tsx @@ -0,0 +1,44 @@ +import * as React from 'react' +import { UiView } from '../ui-view' +import { Button } from '../lib/button' +import { Octicon, OcticonSymbol } from '../octicons' + +interface IBlankSlateProps { + +} + +export class BlankSlateView extends React.Component { + public render() { + return ( + +
+
{__DARWIN__ ? 'No Repositories Found' : 'No repositories Found'}
+
+ It's time to add a repository to GitHub Desktop! + Once a repository is added, then you'll be able to COMMIT ALL THE THINGS! +
+
+ +
+
+ + Create a new project and publish it to GitHub + +
+ +
+ + Clone an existing project from GitHub to your computer + +
+ +
+ + Add an existing project on your computer and publish it to GitHub + +
+
+
+ ) + } +} diff --git a/app/src/ui/blank-slate/index.ts b/app/src/ui/blank-slate/index.ts new file mode 100644 index 00000000000..92a3ebc6004 --- /dev/null +++ b/app/src/ui/blank-slate/index.ts @@ -0,0 +1 @@ +export { BlankSlateView } from './blank-slate' From d80b55d5d066a59d5b975865221ffbf84c3e3e3b Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 3 May 2017 14:38:20 -0400 Subject: [PATCH 02/13] Style it --- app/styles/ui/_blank-slate.scss | 59 +++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 app/styles/ui/_blank-slate.scss diff --git a/app/styles/ui/_blank-slate.scss b/app/styles/ui/_blank-slate.scss new file mode 100644 index 00000000000..7d9d8a99af2 --- /dev/null +++ b/app/styles/ui/_blank-slate.scss @@ -0,0 +1,59 @@ +#blank-slate { + display: flex; + justify-content: center; + + .header { + max-width: 490px; + align-self: center; + + text-align: center; + padding-bottom: var(--spacing-double); + + .title { + font-size: var(--font-size-lg); + font-weight: var(--font-weight-semibold); + } + + .subtitle { + + } + } + + .content { + display: flex; + flex-direction: row; + + align-self: center; + } + + .callout { + display: flex; + flex-direction: column; + + max-width: 370px; + align-items: center; + + text-align: center; + + padding-left: 60px; + padding-right: 60px; + + span { + margin: var(--spacing); + font-size: var(--font-size-md); + } + + .octicon { + width: 32px; + height: 32px; + } + + button { + flex-grow: 0; + } + } + + .callout:not(:last-child) { + border-right: var(--base-border); + } +} From 2c240c82a7d1c3c958f4f4b1f1d1c26eaa79a909 Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 3 May 2017 14:38:28 -0400 Subject: [PATCH 03/13] Import the styles --- app/styles/_ui.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/app/styles/_ui.scss b/app/styles/_ui.scss index f54ccd5006e..6e6d3c35d71 100644 --- a/app/styles/_ui.scss +++ b/app/styles/_ui.scss @@ -50,3 +50,4 @@ @import "ui/acknowledgements"; @import "ui/update-notification"; @import "ui/vertical-segmented-control"; +@import "ui/blank-slate"; From 973a6d59821ecab72c7d44a434c7e188f461ddb1 Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 3 May 2017 14:38:32 -0400 Subject: [PATCH 04/13] And use it! --- app/src/ui/app.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/ui/app.tsx b/app/src/ui/app.tsx index 8bf4aa60727..f1e16411b27 100644 --- a/app/src/ui/app.tsx +++ b/app/src/ui/app.tsx @@ -41,6 +41,7 @@ import { getVersion, getName } from './lib/app-proxy' import { Publish } from './publish-repository' import { Acknowledgements } from './acknowledgements' import { UntrustedCertificate } from './untrusted-certificate' +import { BlankSlateView } from './blank-slate' /** The interval at which we should check for updates. */ const UpdateCheckInterval = 1000 * 60 * 60 * 4 @@ -1062,7 +1063,12 @@ export class App extends React.Component { } private renderRepository() { - const selectedState = this.state.selectedState + const state = this.state + if (state.repositories.length > 0) { + return + } + + const selectedState = state.selectedState if (!selectedState) { return } From afcab7ffbd4e06965051d975e56972d55eecd86b Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 3 May 2017 16:17:07 -0400 Subject: [PATCH 05/13] We don't actually need this style --- app/src/ui/blank-slate/blank-slate.tsx | 2 +- app/styles/ui/_blank-slate.scss | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/app/src/ui/blank-slate/blank-slate.tsx b/app/src/ui/blank-slate/blank-slate.tsx index 9341b30dad8..62f0e7022af 100644 --- a/app/src/ui/blank-slate/blank-slate.tsx +++ b/app/src/ui/blank-slate/blank-slate.tsx @@ -13,7 +13,7 @@ export class BlankSlateView extends React.Component {
{__DARWIN__ ? 'No Repositories Found' : 'No repositories Found'}
-
+
It's time to add a repository to GitHub Desktop! Once a repository is added, then you'll be able to COMMIT ALL THE THINGS!
diff --git a/app/styles/ui/_blank-slate.scss b/app/styles/ui/_blank-slate.scss index 7d9d8a99af2..7561337b229 100644 --- a/app/styles/ui/_blank-slate.scss +++ b/app/styles/ui/_blank-slate.scss @@ -13,10 +13,6 @@ font-size: var(--font-size-lg); font-weight: var(--font-weight-semibold); } - - .subtitle { - - } } .content { From 28a625a063318044599e2b1b8145fd44b324675a Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 3 May 2017 16:17:13 -0400 Subject: [PATCH 06/13] Hook up the buttons --- app/src/ui/app.tsx | 12 ++++++++---- app/src/ui/blank-slate/blank-slate.tsx | 16 ++++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/app/src/ui/app.tsx b/app/src/ui/app.tsx index f1e16411b27..a7bea62eedd 100644 --- a/app/src/ui/app.tsx +++ b/app/src/ui/app.tsx @@ -263,7 +263,7 @@ export class App extends React.Component { case 'create-branch': return this.showCreateBranch() case 'show-branches': return this.showBranches() case 'remove-repository': return this.removeRepository() - case 'create-repository': return this.createRepository() + case 'create-repository': return this.showCreateRepository() case 'rename-branch': return this.renameBranch() case 'delete-branch': return this.deleteBranch() case 'check-for-updates': return this.checkForUpdates() @@ -383,13 +383,13 @@ export class App extends React.Component { return this.props.dispatcher.showPopup({ type: PopupType.AddRepository }) } - private createRepository() { + private showCreateRepository = () => { this.props.dispatcher.showPopup({ type: PopupType.CreateRepository, }) } - private showCloneRepo() { + private showCloneRepo = () => { return this.props.dispatcher.showPopup({ type: PopupType.CloneRepository }) } @@ -1065,7 +1065,11 @@ export class App extends React.Component { private renderRepository() { const state = this.state if (state.repositories.length > 0) { - return + return } const selectedState = state.selectedState diff --git a/app/src/ui/blank-slate/blank-slate.tsx b/app/src/ui/blank-slate/blank-slate.tsx index 62f0e7022af..93809d0a5b0 100644 --- a/app/src/ui/blank-slate/blank-slate.tsx +++ b/app/src/ui/blank-slate/blank-slate.tsx @@ -4,7 +4,9 @@ import { Button } from '../lib/button' import { Octicon, OcticonSymbol } from '../octicons' interface IBlankSlateProps { - + readonly onCreate: () => void + readonly onClone: () => void + readonly onAdd: () => void } export class BlankSlateView extends React.Component { @@ -23,19 +25,25 @@ export class BlankSlateView extends React.Component {
Create a new project and publish it to GitHub - +
Clone an existing project from GitHub to your computer - +
Add an existing project on your computer and publish it to GitHub - +
From 0ecd1e6af6438c567815db9461b0a68406e32ff9 Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 3 May 2017 16:21:24 -0400 Subject: [PATCH 07/13] But really --- app/src/ui/app.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/ui/app.tsx b/app/src/ui/app.tsx index a7bea62eedd..a466ec914b9 100644 --- a/app/src/ui/app.tsx +++ b/app/src/ui/app.tsx @@ -1064,7 +1064,7 @@ export class App extends React.Component { private renderRepository() { const state = this.state - if (state.repositories.length > 0) { + if (state.repositories.length < 1) { return Date: Wed, 3 May 2017 16:25:05 -0400 Subject: [PATCH 08/13] :book: --- app/src/ui/blank-slate/blank-slate.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/ui/blank-slate/blank-slate.tsx b/app/src/ui/blank-slate/blank-slate.tsx index 93809d0a5b0..cc0fe2c8293 100644 --- a/app/src/ui/blank-slate/blank-slate.tsx +++ b/app/src/ui/blank-slate/blank-slate.tsx @@ -4,11 +4,20 @@ import { Button } from '../lib/button' import { Octicon, OcticonSymbol } from '../octicons' interface IBlankSlateProps { + /** A function to call when the user chooses to create a repository. */ readonly onCreate: () => void + + /** A function to call when the user chooses to clone a repository. */ readonly onClone: () => void + + /** A function to call when the user chooses to add a local repository. */ readonly onAdd: () => void } +/** + * The blank slate view. This is shown when the user hasn't added any + * repositories to the app. + */ export class BlankSlateView extends React.Component { public render() { return ( From 790eaabe95308bf75ae99066e54951fbfa77dbf3 Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 3 May 2017 16:25:26 -0400 Subject: [PATCH 09/13] :fire: loading state --- app/src/lib/app-state.ts | 1 - app/src/lib/dispatcher/app-store.ts | 1 - app/src/ui/app.tsx | 3 +-- app/src/ui/repositories-list/index.tsx | 14 -------------- 4 files changed, 1 insertion(+), 18 deletions(-) diff --git a/app/src/lib/app-state.ts b/app/src/lib/app-state.ts index 0c5e1ec6b77..1cd1e9525cb 100644 --- a/app/src/lib/app-state.ts +++ b/app/src/lib/app-state.ts @@ -47,7 +47,6 @@ export interface IAppState { */ readonly windowState: WindowState readonly showWelcomeFlow: boolean - readonly loading: boolean readonly currentPopup: Popup | null readonly currentFoldout: Foldout | null diff --git a/app/src/lib/dispatcher/app-store.ts b/app/src/lib/dispatcher/app-store.ts index 4405152c2bc..199f2097f14 100644 --- a/app/src/lib/dispatcher/app-store.ts +++ b/app/src/lib/dispatcher/app-store.ts @@ -348,7 +348,6 @@ export class AppStore { currentPopup: this.currentPopup, currentFoldout: this.currentFoldout, errors: this.errors, - loading: this.loading, showWelcomeFlow: this.showWelcomeFlow, emoji: this.emojiStore.emoji, sidebarWidth: this.sidebarWidth, diff --git a/app/src/ui/app.tsx b/app/src/ui/app.tsx index a466ec914b9..c956ed72217 100644 --- a/app/src/ui/app.tsx +++ b/app/src/ui/app.tsx @@ -918,8 +918,7 @@ export class App extends React.Component { onSelectionChanged={this.onSelectionChanged} dispatcher={this.props.dispatcher} repositories={this.state.repositories} - loading={this.state.loading} - /> + /> } private onRepositoryDropdownStateChanged = (newState: DropdownState) => { diff --git a/app/src/ui/repositories-list/index.tsx b/app/src/ui/repositories-list/index.tsx index 7d3ddaafa57..63d134f839b 100644 --- a/app/src/ui/repositories-list/index.tsx +++ b/app/src/ui/repositories-list/index.tsx @@ -17,7 +17,6 @@ interface IRepositoriesListProps { readonly selectedRepository: Repositoryish | null readonly onSelectionChanged: (repository: Repositoryish) => void readonly dispatcher: Dispatcher - readonly loading: boolean readonly repositories: ReadonlyArray } @@ -65,10 +64,6 @@ export class RepositoriesList extends React.Component
) } - - private loading() { - return ( -
-
-
Loading…
-
-
) - } } From d9740f7df34ee71a53afe37e8d04af8225a34054 Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 3 May 2017 16:37:16 -0400 Subject: [PATCH 10/13] Lower case harder --- app/src/ui/blank-slate/blank-slate.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/ui/blank-slate/blank-slate.tsx b/app/src/ui/blank-slate/blank-slate.tsx index cc0fe2c8293..297ecce41da 100644 --- a/app/src/ui/blank-slate/blank-slate.tsx +++ b/app/src/ui/blank-slate/blank-slate.tsx @@ -23,7 +23,7 @@ export class BlankSlateView extends React.Component { return (
-
{__DARWIN__ ? 'No Repositories Found' : 'No repositories Found'}
+
{__DARWIN__ ? 'No Repositories Found' : 'No repositories found'}
It's time to add a repository to GitHub Desktop! Once a repository is added, then you'll be able to COMMIT ALL THE THINGS! From e18816343f84c8b56f02b79d9b8d2c95ef55d268 Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 3 May 2017 17:26:23 -0400 Subject: [PATCH 11/13] srs --- app/src/ui/blank-slate/blank-slate.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/ui/blank-slate/blank-slate.tsx b/app/src/ui/blank-slate/blank-slate.tsx index 297ecce41da..8a280a71413 100644 --- a/app/src/ui/blank-slate/blank-slate.tsx +++ b/app/src/ui/blank-slate/blank-slate.tsx @@ -25,8 +25,7 @@ export class BlankSlateView extends React.Component {
{__DARWIN__ ? 'No Repositories Found' : 'No repositories found'}
- It's time to add a repository to GitHub Desktop! - Once a repository is added, then you'll be able to COMMIT ALL THE THINGS! + Add or create a repository so that you can start committing code and publish it to GitHub.
From a91784048526c25b97d1e05156048f462ec8e24b Mon Sep 17 00:00:00 2001 From: joshaber Date: Thu, 4 May 2017 07:50:29 -0400 Subject: [PATCH 12/13] Divs make the world go round --- app/src/ui/blank-slate/blank-slate.tsx | 6 +++--- app/styles/ui/_blank-slate.scss | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/ui/blank-slate/blank-slate.tsx b/app/src/ui/blank-slate/blank-slate.tsx index 8a280a71413..eda7f775718 100644 --- a/app/src/ui/blank-slate/blank-slate.tsx +++ b/app/src/ui/blank-slate/blank-slate.tsx @@ -32,7 +32,7 @@ export class BlankSlateView extends React.Component {
- Create a new project and publish it to GitHub +
Create a new project and publish it to GitHub
@@ -40,7 +40,7 @@ export class BlankSlateView extends React.Component {
- Clone an existing project from GitHub to your computer +
Clone an existing project from GitHub to your computer
@@ -48,7 +48,7 @@ export class BlankSlateView extends React.Component {
- Add an existing project on your computer and publish it to GitHub +
Add an existing project on your computer and publish it to GitHub
diff --git a/app/styles/ui/_blank-slate.scss b/app/styles/ui/_blank-slate.scss index 7561337b229..fed439fb33c 100644 --- a/app/styles/ui/_blank-slate.scss +++ b/app/styles/ui/_blank-slate.scss @@ -34,7 +34,7 @@ padding-left: 60px; padding-right: 60px; - span { + div { margin: var(--spacing); font-size: var(--font-size-md); } From 19cb1b3d224833eb2aab85e6ebaf88a15c0fbec5 Mon Sep 17 00:00:00 2001 From: joshaber Date: Thu, 4 May 2017 07:51:23 -0400 Subject: [PATCH 13/13] One life one line --- app/styles/ui/_blank-slate.scss | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/styles/ui/_blank-slate.scss b/app/styles/ui/_blank-slate.scss index fed439fb33c..b0e0a4489e8 100644 --- a/app/styles/ui/_blank-slate.scss +++ b/app/styles/ui/_blank-slate.scss @@ -31,8 +31,7 @@ text-align: center; - padding-left: 60px; - padding-right: 60px; + padding: 0 60px; div { margin: var(--spacing);