-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'jeffdaley/product-avatar' into jeffdaley/explore-projects
- Loading branch information
Showing
13 changed files
with
125 additions
and
53 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
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,21 @@ | ||
import { helper } from "@ember/component/helper"; | ||
|
||
export interface GetLetterCountHelperSignature { | ||
Args: { | ||
Positional: [text: string]; | ||
}; | ||
Return: string | null; | ||
} | ||
const getLetterCount = helper<GetLetterCountHelperSignature>( | ||
([text]: [string]) => { | ||
return text.length.toString(); | ||
}, | ||
); | ||
|
||
export default getLetterCount; | ||
|
||
declare module "@glint/environment-ember-loose/registry" { | ||
export default interface Registry { | ||
"get-letter-count": typeof getLetterCount; | ||
} | ||
} |
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,50 @@ | ||
import Helper from "@ember/component/helper"; | ||
import { inject as service } from "@ember/service"; | ||
import ProductAreasService from "hermes/services/product-areas"; | ||
|
||
export interface GetProductAbbreviationHelperSignature { | ||
Args: { | ||
Positional: [productName?: string]; | ||
}; | ||
Return: string; | ||
} | ||
|
||
// const getProductAbbreviation = helper<GetProductAbbreviationHelperSignature>( | ||
// ([productName]: [string]) => { | ||
|
||
// const nameParts = productName.split("-"); | ||
// const abbreviation = nameParts[0]; | ||
|
||
// if (abbreviation) { | ||
// return abbreviation.slice(0, 3).toUpperCase(); | ||
// } | ||
|
||
// return ""; | ||
// }, | ||
// ); | ||
|
||
export default class GetProductAbbreviationHelper extends Helper<GetProductAbbreviationHelperSignature> { | ||
@service declare productAreas: ProductAreasService; | ||
|
||
compute([productName]: [string | undefined]): string { | ||
if (!productName) { | ||
return ""; | ||
} | ||
|
||
// need to search the productAreas index for an object called `productName` and return the abbreviation | ||
const products = this.productAreas.index; | ||
const product = products?.[productName]; | ||
|
||
if (!product) { | ||
return ""; | ||
} | ||
|
||
return product.abbreviation.slice(0, 3).toUpperCase(); | ||
} | ||
} | ||
|
||
declare module "@glint/environment-ember-loose/registry" { | ||
export default interface Registry { | ||
"get-doc-abbreviation": typeof GetProductAbbreviationHelper; | ||
} | ||
} |
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
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,11 @@ | ||
.letter-avatar { | ||
@apply tracking-tighter; | ||
|
||
&.letter-count-2 { | ||
@apply text-[11px]; | ||
} | ||
|
||
&.letter-count-3 { | ||
@apply text-[9px]; | ||
} | ||
} |
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