4
0
forked from crowetic/commerce

Added links to pages in the footer

This commit is contained in:
Luis Alvarez
2020-10-15 14:00:41 -05:00
parent a0e5448210
commit a0b85bcf5b
8 changed files with 85 additions and 44 deletions

5
utils/get-slug.ts Normal file
View File

@@ -0,0 +1,5 @@
// Remove trailing and leading slash, usually included in nodes
// returned by the BigCommerce API
const getSlug = (path: string) => path.replace(/^\/|\/$/g, '')
export default getSlug

View File

@@ -34,9 +34,6 @@ export const filterQuery = (query: any) =>
return obj
}, {})
// Remove trailing and leading slash
export const getSlug = (path: string) => path.replace(/^\/|\/$/g, '')
export const getCategoryPath = (slug: string, brand?: string) =>
`/search${brand ? `/designers/${brand}` : ''}${slug ? `/${slug}` : ''}`