-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added navbar and footer to main layout; added about and tests routes
- Loading branch information
1 parent
a901cd9
commit a7da979
Showing
12 changed files
with
197 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<footer class="menu"> | ||
<div class="links"> | ||
{{#each this.links as |link|}} | ||
<a href={{link.url}} | ||
class="menu-{{link.route}}" | ||
target={{link.target}} | ||
> | ||
{{link.title}} | ||
</a> | ||
{{/each}} | ||
</div> | ||
</footer> |
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,23 @@ | ||
import Component from '@glimmer/component'; | ||
|
||
export default class FooterComponent extends Component { | ||
get links() { | ||
const links = []; | ||
|
||
links.push({ | ||
url: 'https://github.com/michaelchadwick/ember-fake-chat', | ||
route: 'source', | ||
title: 'Github Source', | ||
target: '_blank', | ||
}); | ||
|
||
links.push({ | ||
url: 'https://guides.emberjs.com/release/components/', | ||
route: 'tutorial', | ||
title: 'Ember Tutorial', | ||
target: '_blank', | ||
}); | ||
|
||
return links; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<h2>Messages</h2> | ||
<div class="messages"> | ||
{{#each this.messages as |message index|}} | ||
<Message | ||
|
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,17 @@ | ||
<nav class="menu"> | ||
<LinkTo @route="index" class="menu-index"> | ||
<h1>Ember Fake Chat</h1> | ||
</LinkTo> | ||
|
||
<div class="links"> | ||
{{#each this.links as |link|}} | ||
<LinkTo | ||
@route={{link.route}} | ||
class="menu-{{link.route}}" | ||
target={{link.target}} | ||
> | ||
{{link.title}} | ||
</LinkTo> | ||
{{/each}} | ||
</div> | ||
</nav> |
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,24 @@ | ||
import Component from '@glimmer/component'; | ||
import ENV from 'ember-fake-chat/config/environment'; | ||
|
||
export default class NavBarComponent extends Component { | ||
get links() { | ||
const links = []; | ||
|
||
links.push({ | ||
route: 'about', | ||
title: 'About', | ||
target: '_self', | ||
}); | ||
|
||
if (ENV.environment != 'production') { | ||
links.push({ | ||
route: 'tests', | ||
title: 'Tests', | ||
target: '_blank', | ||
}); | ||
} | ||
|
||
return links; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,9 +1,16 @@ | ||
import EmberRouter from '@ember/routing/router'; | ||
import config from 'ember-fake-chat/config/environment'; | ||
import ENV from 'ember-fake-chat/config/environment'; | ||
|
||
export default class Router extends EmberRouter { | ||
location = config.locationType; | ||
rootURL = config.rootURL; | ||
} | ||
|
||
Router.map(function () {}); | ||
Router.map(function () { | ||
this.route('about'); | ||
|
||
if (ENV.environment != 'production') { | ||
this.route('tests', { path: '/tests?nocontainer' }); | ||
} | ||
}); |
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,3 @@ | ||
import Route from '@ember/routing/route'; | ||
|
||
export default class AboutRoute extends Route {} |
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,15 @@ | ||
<h2>About</h2> | ||
<p> | ||
<strong>Ember Fake Chat</strong> | ||
is a web application built to learn about EmberJS Components. | ||
</p> | ||
|
||
<p> | ||
It is a poor chat application, however, as it only allows you to read existing | ||
hard-coded messages, and only add new ones as anonymous. There are no users, | ||
there is no user authentication, and there is no database to keep track of | ||
anything. | ||
</p> | ||
|
||
<p>But it's a start! | ||
</p> |
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 @@ | ||
<Messages /> |
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,11 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-fake-chat/tests/helpers'; | ||
|
||
module('Unit | Route | about', function (hooks) { | ||
setupTest(hooks); | ||
|
||
test('it exists', function (assert) { | ||
let route = this.owner.lookup('route:about'); | ||
assert.ok(route); | ||
}); | ||
}); |