Skip to content

Commit

Permalink
269 create a hero section on the front page (#271)
Browse files Browse the repository at this point in the history
* Fix window not defined error #269

* Fix window not defined

* Nice

* Hero on website displaying team, fix window not defined, maybe fixed epileptic epileptic seizure from globe?

* Prettier and lint
  • Loading branch information
EliasKnudsen authored and GitHub committed Apr 13, 2024
1 parent e534241 commit 82c6249
Show file tree
Hide file tree
Showing 12 changed files with 402 additions and 107 deletions.
30 changes: 30 additions & 0 deletions backend/src/api/hero/content-types/hero/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"kind": "singleType",
"collectionName": "heroes",
"info": {
"singularName": "hero",
"pluralName": "heroes",
"displayName": "Hero",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"image": {
"type": "media",
"multiple": false,
"required": true,
"allowedTypes": [
"images",
"files",
"videos",
"audios"
]
},
"text": {
"type": "text"
}
}
}
9 changes: 9 additions & 0 deletions backend/src/api/hero/controllers/hero.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* hero controller
*/

const { createCoreController } = require('@strapi/strapi').factories;

module.exports = createCoreController('api::hero.hero');
9 changes: 9 additions & 0 deletions backend/src/api/hero/routes/hero.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* hero router
*/

const { createCoreRouter } = require('@strapi/strapi').factories;

module.exports = createCoreRouter('api::hero.hero');
9 changes: 9 additions & 0 deletions backend/src/api/hero/services/hero.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* hero service
*/

const { createCoreService } = require('@strapi/strapi').factories;

module.exports = createCoreService('api::hero.hero');
32 changes: 25 additions & 7 deletions backend/types/generated/contentTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -512,12 +512,6 @@ export interface PluginContentReleasesRelease extends Schema.CollectionType {
attributes: {
name: Attribute.String & Attribute.Required;
releasedAt: Attribute.DateTime;
scheduledAt: Attribute.DateTime;
timezone: Attribute.String;
status: Attribute.Enumeration<
['ready', 'blocked', 'failed', 'done', 'empty']
> &
Attribute.Required;
actions: Attribute.Relation<
'plugin::content-releases.release',
'oneToMany',
Expand Down Expand Up @@ -572,7 +566,6 @@ export interface PluginContentReleasesReleaseAction
'manyToOne',
'plugin::content-releases.release'
>;
isEntryValid: Attribute.Boolean;
createdAt: Attribute.DateTime;
updatedAt: Attribute.DateTime;
createdBy: Attribute.Relation<
Expand Down Expand Up @@ -865,6 +858,30 @@ export interface ApiAuthorAuthor extends Schema.CollectionType {
};
}

export interface ApiHeroHero extends Schema.SingleType {
collectionName: 'heroes';
info: {
singularName: 'hero';
pluralName: 'heroes';
displayName: 'Hero';
description: '';
};
options: {
draftAndPublish: true;
};
attributes: {
image: Attribute.Media & Attribute.Required;
text: Attribute.Text;
createdAt: Attribute.DateTime;
updatedAt: Attribute.DateTime;
publishedAt: Attribute.DateTime;
createdBy: Attribute.Relation<'api::hero.hero', 'oneToOne', 'admin::user'> &
Attribute.Private;
updatedBy: Attribute.Relation<'api::hero.hero', 'oneToOne', 'admin::user'> &
Attribute.Private;
};
}

export interface ApiMostRecentImageMostRecentImage
extends Schema.CollectionType {
collectionName: 'most_recent_images';
Expand Down Expand Up @@ -1006,6 +1023,7 @@ declare module '@strapi/types' {
'plugin::users-permissions.user': PluginUsersPermissionsUser;
'api::article.article': ApiArticleArticle;
'api::author.author': ApiAuthorAuthor;
'api::hero.hero': ApiHeroHero;
'api::most-recent-image.most-recent-image': ApiMostRecentImageMostRecentImage;
'api::project.project': ApiProjectProject;
'api::satellite.satellite': ApiSatelliteSatellite;
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/__generated__/gql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 82c6249

Please sign in to comment.