-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add `branding show` * Add `branding update` * Remove color default values
- Loading branch information
Showing
3 changed files
with
235 additions
and
3 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
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,51 @@ | ||
package display | ||
|
||
import ( | ||
"gopkg.in/auth0.v5/management" | ||
) | ||
|
||
type brandingView struct { | ||
AccentColor string | ||
BackgroundColor string | ||
LogoURL string | ||
FaviconURL string | ||
CustomFontURL string | ||
} | ||
|
||
func (v *brandingView) AsTableHeader() []string { | ||
return []string{} | ||
} | ||
|
||
func (v *brandingView) AsTableRow() []string { | ||
return []string{} | ||
} | ||
|
||
func (v *brandingView) KeyValues() [][]string { | ||
return [][]string{ | ||
{"ACCENT COLOR", v.AccentColor}, | ||
{"BACKGROUND COLOR", v.BackgroundColor}, | ||
{"LOGO URL", v.LogoURL}, | ||
{"FAVICON URL", v.FaviconURL}, | ||
{"CUSTOM FONT URL", v.CustomFontURL}, | ||
} | ||
} | ||
|
||
func (r *Renderer) BrandingShow(data *management.Branding) { | ||
r.Heading("branding") | ||
r.Result(makeBrandingView(data)) | ||
} | ||
|
||
func (r *Renderer) BrandingUpdate(data *management.Branding) { | ||
r.Heading("branding updated") | ||
r.Result(makeBrandingView(data)) | ||
} | ||
|
||
func makeBrandingView(data *management.Branding) *brandingView { | ||
return &brandingView{ | ||
AccentColor: data.GetColors().GetPrimary(), | ||
BackgroundColor: data.GetColors().GetPageBackground(), | ||
LogoURL: data.GetLogoURL(), | ||
FaviconURL: data.GetFaviconURL(), | ||
CustomFontURL: data.GetFont().GetURL(), | ||
} | ||
} |