Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions src/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import cbLogo from './assets/CB-stacked-logo-full-color.svg'
export const Home = () => {
const featureFlags = useFeatureFlags()

const showMessage = useFeatureFlag(namespaceFlags.default.showMessage)
const showMessage = true

if (featureFlags.loading) {
return (
Expand All @@ -20,16 +20,14 @@ export const Home = () => {
<>
<h1>CloudBees feature management React sample application</h1>
<div className="card">
{showMessage && (
<p
style={{
color: featureFlags.default.fontColor.getValue(),
fontSize: featureFlags.default.fontSize.getValue(),
}}
>
{featureFlags.default.message.getValue()}
</p>
)}
{<p
style={{
color: featureFlags.default.fontColor.getValue(),
fontSize: featureFlags.default.fontSize.getValue(),
}}
>
{featureFlags.default.message.getValue()}
</p>}
</div>

<div className="card">
Expand All @@ -43,4 +41,4 @@ export const Home = () => {
</div>
</>
)
}
}
4 changes: 1 addition & 3 deletions src/feature-management/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ export const namespaceFlags = {
about: new Flag(false),
},
default: {
// Boolean - should the message be shown?
showMessage: new Flag(),
// String - the message to show.
message: new RoxString(
'This is the default message; try changing some flag values!'
Expand All @@ -26,4 +24,4 @@ export const namespaceFlags = {
// Number (with options) - the size of the message text.
fontSize: new RoxNumber(24, [12, 16, 24]),
},
}
}