Skip to content

Commit

Permalink
Merge pull request #1 from sliitsesc/feat/add-navbar-homepage
Browse files Browse the repository at this point in the history
feat: add navbar + landingpage structure
  • Loading branch information
pawan-live authored Dec 26, 2024
2 parents 6f00493 + 782fa04 commit 54a655a
Show file tree
Hide file tree
Showing 12 changed files with 274 additions and 33 deletions.
37 changes: 37 additions & 0 deletions src/api/category/content-types/category/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"kind": "collectionType",
"collectionName": "categories",
"info": {
"singularName": "category",
"pluralName": "categories",
"displayName": "Categories"
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {
"i18n": {
"localized": true
}
},
"attributes": {
"name": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "string",
"required": true
},
"slug": {
"pluginOptions": {
"i18n": {
"localized": false
}
},
"type": "string",
"required": true
}
}
}
7 changes: 7 additions & 0 deletions src/api/category/controllers/category.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* category controller
*/

import { factories } from '@strapi/strapi'

export default factories.createCoreController('api::category.category');
7 changes: 7 additions & 0 deletions src/api/category/routes/category.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* category router
*/

import { factories } from '@strapi/strapi';

export default factories.createCoreRouter('api::category.category');
7 changes: 7 additions & 0 deletions src/api/category/services/category.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* category service
*/

import { factories } from '@strapi/strapi';

export default factories.createCoreService('api::category.category');
56 changes: 52 additions & 4 deletions src/api/landing-page/content-types/landing-page/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"info": {
"singularName": "landing-page",
"pluralName": "landing-pages",
"displayName": "Landing Page"
"displayName": "Landing Page",
"description": ""
},
"options": {
"draftAndPublish": true
Expand All @@ -15,16 +16,63 @@
}
},
"attributes": {
"heroSection": {
"displayName": "Hero Section",
"heroMainTitle": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "string"
},
"heroSubtitle": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "text"
},
"heroButton": {
"type": "component",
"repeatable": false,
"pluginOptions": {
"i18n": {
"localized": true
}
},
"component": "landing-page.hero-section"
"component": "common.button"
},
"heroImage": {
"displayName": "Image",
"type": "component",
"repeatable": false,
"pluginOptions": {
"i18n": {
"localized": true
}
},
"component": "common.image"
},
"mainCategoriesTitle": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "string"
},
"mainCategoriesDescription": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "string"
},
"mainCategoriesList": {
"type": "relation",
"relation": "oneToMany",
"target": "api::category.category"
}
}
}
14 changes: 13 additions & 1 deletion src/api/navbar/content-types/navbar/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"info": {
"singularName": "navbar",
"pluralName": "navbars",
"displayName": "Navbar"
"displayName": "Navbar",
"description": ""
},
"options": {
"draftAndPublish": true
Expand All @@ -25,6 +26,17 @@
}
},
"component": "common.link"
},
"navbarButton": {
"displayName": "Button",
"type": "component",
"repeatable": false,
"pluginOptions": {
"i18n": {
"localized": true
}
},
"component": "common.button"
}
}
}
17 changes: 17 additions & 0 deletions src/components/common/button.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"collectionName": "components_common_buttons",
"info": {
"displayName": "Button",
"description": ""
},
"options": {},
"attributes": {
"buttonText": {
"type": "string",
"required": true
},
"buttonLink": {
"type": "string"
}
}
}
16 changes: 16 additions & 0 deletions src/components/common/image.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"collectionName": "components_common_images",
"info": {
"displayName": "Image",
"icon": "picture"
},
"options": {},
"attributes": {
"imageUrl": {
"type": "string"
},
"imageAlt": {
"type": "string"
}
}
}
3 changes: 2 additions & 1 deletion src/components/common/link.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"collectionName": "components_common_links",
"info": {
"displayName": "Link",
"icon": "link"
"icon": "link",
"description": ""
},
"options": {},
"attributes": {
Expand Down
12 changes: 0 additions & 12 deletions src/components/landing-page/hero-section.json

This file was deleted.

38 changes: 27 additions & 11 deletions types/generated/components.d.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,48 @@
import type { Schema, Struct } from '@strapi/strapi';

export interface CommonLink extends Struct.ComponentSchema {
collectionName: 'components_common_links';
export interface CommonButton extends Struct.ComponentSchema {
collectionName: 'components_common_buttons';
info: {
displayName: 'Link';
icon: 'link';
description: '';
displayName: 'Button';
};
attributes: {
linkText: Schema.Attribute.String;
linkUrl: Schema.Attribute.String;
buttonLink: Schema.Attribute.String;
buttonText: Schema.Attribute.String & Schema.Attribute.Required;
};
}

export interface CommonImage extends Struct.ComponentSchema {
collectionName: 'components_common_images';
info: {
displayName: 'Image';
icon: 'picture';
};
attributes: {
imageAlt: Schema.Attribute.String;
imageUrl: Schema.Attribute.String;
};
}

export interface LandingPageHeroSection extends Struct.ComponentSchema {
collectionName: 'components_landing_page_hero_sections';
export interface CommonLink extends Struct.ComponentSchema {
collectionName: 'components_common_links';
info: {
displayName: 'Hero Section';
description: '';
displayName: 'Link';
icon: 'link';
};
attributes: {
mainTitle: Schema.Attribute.String;
linkText: Schema.Attribute.String;
linkUrl: Schema.Attribute.String;
};
}

declare module '@strapi/strapi' {
export module Public {
export interface ComponentSchemas {
'common.button': CommonButton;
'common.image': CommonImage;
'common.link': CommonLink;
'landing-page.hero-section': LandingPageHeroSection;
}
}
}
Loading

0 comments on commit 54a655a

Please sign in to comment.