Last active
October 14, 2020 18:50
-
-
Save ASH-Michael/724a35f93c3eee1e376d1d360ebbfe32 to your computer and use it in GitHub Desktop.
Presentation Components within a Presentationless Component
This file contains hidden or 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
import Component from '@ember/component'; | |
import { computed, get } from '@ember/object'; | |
import { htmlSafe } from '@ember/string'; | |
export default Component.extend({ | |
centerName: 'Orange Theory', | |
centerProfile: 'https://fakeimg.pl/120x120/', | |
centerAddress: '32435 Temecula Pkwy', | |
centerCity: 'Temecula', | |
centerState: 'CA', | |
centerZip: '92592', | |
monthlyRate: '89.00', | |
formattedCenterAddress: computed('centerAddress1', 'centerAddress2', function () { | |
const centerAddress = get(this, 'centerAddress'); | |
const centerCity = get(this, 'centerCity'); | |
const centerState = get(this, 'centerState'); | |
const centerZip = get(this, 'centerZip'); | |
return htmlSafe(`<span>${centerAddress}</span> | |
<span>${centerCity}, ${centerState} ${centerZip}</span>` | |
); | |
}) | |
}); |
This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
tagName: 'section', | |
classNames: ['centerDetailCard'] | |
}); |
This file contains hidden or 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
import Component from '@ember/component'; | |
import { computed, get } from '@ember/object'; | |
export default Component.extend({ | |
tagName: 'span', | |
classNames: ['providerCenterAndRate'] | |
}); |
This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
tagName: 'span', | |
classNames: ['providerMonthlyRate'] | |
}); |
This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
}); |
This file contains hidden or 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
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
} | |
h1 { | |
color: purple; | |
} | |
.centerDetailCard { | |
padding: 1rem; | |
border: 1px solid #cccccc; | |
display: flex; | |
} | |
.centerDetailCard div { | |
margin-left: 1rem; | |
} | |
.centerDetailCard p:first-of-type { | |
margin-top: 0; | |
} | |
.cardAddress span { | |
display: block; | |
} |
This file contains hidden or 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
{ | |
"version": "0.15.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "2.18.2", | |
"ember-template-compiler": "2.18.2", | |
"ember-testing": "2.18.2" | |
}, | |
"addons": { | |
"ember-data": "2.18.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment