diff --git a/back/config/admin.js b/back/config/admin.js index 84c9a19..8280874 100644 --- a/back/config/admin.js +++ b/back/config/admin.js @@ -5,5 +5,10 @@ module.exports = ({ env }) => ({ apiToken: { salt: env("API_TOKEN_SALT", "4444a34644486306e97051f610dfdae4"), }, + transfer: { + token: { + salt: env("TRANSFER_SALT", "NDDFL8BZi0QK5oYDbRgNow=="), + }, + }, url: "/kudeatu", }); diff --git a/back/config/env/production/database.js b/back/config/env/production/database.js index a16f55a..a58e09a 100644 --- a/back/config/env/production/database.js +++ b/back/config/env/production/database.js @@ -1,19 +1,15 @@ -const parse = require("pg-connection-string").parse; -const config = parse(process.env.DATABASE_URL); +const path = require("path"); module.exports = ({ env }) => ({ connection: { - client: "postgres", + client: "sqlite", connection: { - host: config.host, - port: config.port, - database: config.database, - user: config.user, - password: config.password, - ssl: { - rejectUnauthorized: false, - }, + filename: path.join( + __dirname, + "..", + env("DATABASE_FILENAME", "./data.db") + ), }, - debug: false, + useNullAsDefault: true, }, }); diff --git a/back/config/env/production/server.js b/back/config/env/production/server.js index dc83826..57c6dc3 100644 --- a/back/config/env/production/server.js +++ b/back/config/env/production/server.js @@ -1,5 +1,5 @@ module.exports = ({ env }) => ({ - url: env("PUBLIC_URL", "https://fast-springs-77208.herokuapp.com"), + url: env("PUBLIC_URL", "https://vervet-big-dassie.ngrok-free.app"), host: env("HOST", "0.0.0.0"), port: env.int("PORT", 1337), }); diff --git a/back/config/middlewares.js b/back/config/middlewares.js index 2a307c0..520fcc1 100644 --- a/back/config/middlewares.js +++ b/back/config/middlewares.js @@ -7,8 +7,20 @@ module.exports = [ useDefaults: true, directives: { "connect-src": ["'self'", "https:"], - "img-src": ["'self'", "data:", "blob:", "res.cloudinary.com"], - "media-src": ["'self'", "data:", "blob:", "res.cloudinary.com"], + "img-src": [ + "'self'", + "data:", + "blob:", + "market-assets.strapi.io", + "res.cloudinary.com", + ], + "media-src": [ + "'self'", + "data:", + "blob:", + "market-assets.strapi.io", + "res.cloudinary.com", + ], upgradeInsecureRequests: null, }, }, diff --git a/back/config/plugins.js b/back/config/plugins.js index 55309b4..0e3cb09 100644 --- a/back/config/plugins.js +++ b/back/config/plugins.js @@ -1,4 +1,18 @@ -module.exports = { +module.exports = ({ env }) => ({ + upload: { + config: { + provider: "cloudinary", + providerOptions: { + cloud_name: env("CLOUDINARY_NAME"), + api_key: env("CLOUDINARY_KEY"), + api_secret: env("CLOUDINARY_SECRET"), + }, + actionOptions: { + upload: {}, + delete: {}, + }, + }, + }, graphql: { config: { endpoint: "/graphql", @@ -26,4 +40,4 @@ module.exports = { ], }, }, -}; +}); diff --git a/back/database/migrations/development.db b/back/database/migrations/development.db index 8143870..72dffdd 100644 Binary files a/back/database/migrations/development.db and b/back/database/migrations/development.db differ diff --git a/back/database/migrations/images/uztailak-9-irudia.jpeg b/back/database/migrations/images/uztailak-9-irudia.jpeg deleted file mode 100644 index 29fd7c0..0000000 Binary files a/back/database/migrations/images/uztailak-9-irudia.jpeg and /dev/null differ diff --git a/back/database/migrations/images/uztailak-9.jpeg b/back/database/migrations/images/uztailak-9.jpeg deleted file mode 100644 index 730f194..0000000 Binary files a/back/database/migrations/images/uztailak-9.jpeg and /dev/null differ diff --git a/back/package.json b/back/package.json index e3b067d..69301b9 100644 --- a/back/package.json +++ b/back/package.json @@ -15,17 +15,17 @@ "strapi": "strapi" }, "dependencies": { - "@strapi/plugin-graphql": "^4.16.2", - "@strapi/plugin-i18n": "^4.16.2", - "@strapi/plugin-users-permissions": "^4.16.2", - "@strapi/provider-upload-cloudinary": "^4.16.2", - "@strapi/strapi": "^4.16.2", - "pg": "^8.11.3", - "pg-connection-string": "^2.6.2", - "react": "^18.2.0", - "react-dom": "^18.2.0", + "@strapi/plugin-graphql": "^4.25.17", + "@strapi/plugin-i18n": "^4.25.13", + "@strapi/plugin-users-permissions": "^4.25.17", + "@strapi/provider-upload-cloudinary": "^4.25.17", + "@strapi/strapi": "^4.25.17", + "pg": "^8.13.1", + "pg-connection-string": "^2.7.0", + "react": "^18.3.1", + "react-dom": "^18.3.1", "react-router-dom": "^5.3.4", - "sqlite3": "5.1.6", + "sqlite3": "5.1.7", "strapi-plugin-netlify-deployments": "^2.0.2", "styled-components": "^5.3.11" }, diff --git a/back/src/api/bizi/content-types/bizi/schema.json b/back/src/api/bizi/content-types/bizi/schema.json new file mode 100644 index 0000000..e9fd8e0 --- /dev/null +++ b/back/src/api/bizi/content-types/bizi/schema.json @@ -0,0 +1,22 @@ +{ + "kind": "singleType", + "collectionName": "bizis", + "info": { + "singularName": "bizi", + "pluralName": "bizis", + "displayName": "Bizi" + }, + "options": { + "draftAndPublish": true + }, + "pluginOptions": {}, + "attributes": { + "izenburua": { + "type": "string", + "required": true + }, + "deskribapena": { + "type": "text" + } + } +} diff --git a/back/src/api/bizi/controllers/bizi.js b/back/src/api/bizi/controllers/bizi.js new file mode 100644 index 0000000..2445c3a --- /dev/null +++ b/back/src/api/bizi/controllers/bizi.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * bizi controller + */ + +const { createCoreController } = require('@strapi/strapi').factories; + +module.exports = createCoreController('api::bizi.bizi'); diff --git a/back/src/api/bizi/routes/bizi.js b/back/src/api/bizi/routes/bizi.js new file mode 100644 index 0000000..fd1e4ab --- /dev/null +++ b/back/src/api/bizi/routes/bizi.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * bizi router + */ + +const { createCoreRouter } = require('@strapi/strapi').factories; + +module.exports = createCoreRouter('api::bizi.bizi'); diff --git a/back/src/api/bizi/services/bizi.js b/back/src/api/bizi/services/bizi.js new file mode 100644 index 0000000..6e63792 --- /dev/null +++ b/back/src/api/bizi/services/bizi.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * bizi service + */ + +const { createCoreService } = require('@strapi/strapi').factories; + +module.exports = createCoreService('api::bizi.bizi'); diff --git a/back/src/api/ekintza/content-types/ekintza/schema.json b/back/src/api/ekintza/content-types/ekintza/schema.json new file mode 100644 index 0000000..16c920e --- /dev/null +++ b/back/src/api/ekintza/content-types/ekintza/schema.json @@ -0,0 +1,59 @@ +{ + "kind": "collectionType", + "collectionName": "ekintzak", + "info": { + "singularName": "ekintza", + "pluralName": "ekintzak", + "displayName": "Ekintza", + "description": "" + }, + "options": { + "draftAndPublish": true + }, + "pluginOptions": {}, + "attributes": { + "izenburua": { + "type": "string", + "required": true + }, + "slug": { + "type": "uid", + "targetField": "izenburua", + "required": true + }, + "hitzordua": { + "type": "datetime", + "required": true + }, + "titularra": { + "type": "text" + }, + "elkarlana": { + "type": "component", + "repeatable": true, + "component": "bizi.elkarlana" + }, + "labakoUzta": { + "type": "boolean", + "default": false, + "required": true + }, + "kartela": { + "type": "media", + "multiple": false, + "required": false, + "allowedTypes": [ + "images" + ] + }, + "zikloa": { + "type": "relation", + "relation": "manyToOne", + "target": "api::zikloa.zikloa", + "inversedBy": "ekintzak" + }, + "deskribapena": { + "type": "richtext" + } + } +} diff --git a/back/src/api/ekintza/controllers/ekintza.js b/back/src/api/ekintza/controllers/ekintza.js new file mode 100644 index 0000000..2716737 --- /dev/null +++ b/back/src/api/ekintza/controllers/ekintza.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * ekintza controller + */ + +const { createCoreController } = require('@strapi/strapi').factories; + +module.exports = createCoreController('api::ekintza.ekintza'); diff --git a/back/src/api/ekintza/routes/ekintza.js b/back/src/api/ekintza/routes/ekintza.js new file mode 100644 index 0000000..206d2b9 --- /dev/null +++ b/back/src/api/ekintza/routes/ekintza.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * ekintza router + */ + +const { createCoreRouter } = require('@strapi/strapi').factories; + +module.exports = createCoreRouter('api::ekintza.ekintza'); diff --git a/back/src/api/ekintza/services/ekintza.js b/back/src/api/ekintza/services/ekintza.js new file mode 100644 index 0000000..519c2e8 --- /dev/null +++ b/back/src/api/ekintza/services/ekintza.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * ekintza service + */ + +const { createCoreService } = require('@strapi/strapi').factories; + +module.exports = createCoreService('api::ekintza.ekintza'); diff --git a/back/src/api/erakundea/content-types/erakundea/schema.json b/back/src/api/erakundea/content-types/erakundea/schema.json new file mode 100644 index 0000000..782689b --- /dev/null +++ b/back/src/api/erakundea/content-types/erakundea/schema.json @@ -0,0 +1,32 @@ +{ + "kind": "collectionType", + "collectionName": "erakundeak", + "info": { + "singularName": "erakundea", + "pluralName": "erakundeak", + "displayName": "Erakundea", + "description": "" + }, + "options": { + "draftAndPublish": false + }, + "pluginOptions": {}, + "attributes": { + "izena": { + "type": "string", + "required": true + }, + "esteka": { + "type": "string", + "regex": "[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)" + }, + "logoa": { + "type": "media", + "multiple": false, + "required": false, + "allowedTypes": [ + "images" + ] + } + } +} diff --git a/back/src/api/erakundea/controllers/erakundea.js b/back/src/api/erakundea/controllers/erakundea.js new file mode 100644 index 0000000..e21033d --- /dev/null +++ b/back/src/api/erakundea/controllers/erakundea.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * erakundea controller + */ + +const { createCoreController } = require('@strapi/strapi').factories; + +module.exports = createCoreController('api::erakundea.erakundea'); diff --git a/back/src/api/erakundea/routes/erakundea.js b/back/src/api/erakundea/routes/erakundea.js new file mode 100644 index 0000000..c732110 --- /dev/null +++ b/back/src/api/erakundea/routes/erakundea.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * erakundea router + */ + +const { createCoreRouter } = require('@strapi/strapi').factories; + +module.exports = createCoreRouter('api::erakundea.erakundea'); diff --git a/back/src/api/erakundea/services/erakundea.js b/back/src/api/erakundea/services/erakundea.js new file mode 100644 index 0000000..2d25d73 --- /dev/null +++ b/back/src/api/erakundea/services/erakundea.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * erakundea service + */ + +const { createCoreService } = require('@strapi/strapi').factories; + +module.exports = createCoreService('api::erakundea.erakundea'); diff --git a/back/src/api/zikloa/content-types/zikloa/schema.json b/back/src/api/zikloa/content-types/zikloa/schema.json new file mode 100644 index 0000000..e4a420c --- /dev/null +++ b/back/src/api/zikloa/content-types/zikloa/schema.json @@ -0,0 +1,34 @@ +{ + "kind": "collectionType", + "collectionName": "zikloas", + "info": { + "singularName": "zikloa", + "pluralName": "zikloas", + "displayName": "Zikloa", + "description": "" + }, + "options": { + "draftAndPublish": true + }, + "pluginOptions": {}, + "attributes": { + "izena": { + "type": "string", + "required": true + }, + "deskribapena": { + "type": "richtext" + }, + "slug": { + "type": "uid", + "required": true, + "targetField": "izena" + }, + "ekintzak": { + "type": "relation", + "relation": "oneToMany", + "target": "api::ekintza.ekintza", + "mappedBy": "zikloa" + } + } +} diff --git a/back/src/api/zikloa/controllers/zikloa.js b/back/src/api/zikloa/controllers/zikloa.js new file mode 100644 index 0000000..9e957ce --- /dev/null +++ b/back/src/api/zikloa/controllers/zikloa.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * zikloa controller + */ + +const { createCoreController } = require('@strapi/strapi').factories; + +module.exports = createCoreController('api::zikloa.zikloa'); diff --git a/back/src/api/zikloa/routes/zikloa.js b/back/src/api/zikloa/routes/zikloa.js new file mode 100644 index 0000000..99d5106 --- /dev/null +++ b/back/src/api/zikloa/routes/zikloa.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * zikloa router + */ + +const { createCoreRouter } = require('@strapi/strapi').factories; + +module.exports = createCoreRouter('api::zikloa.zikloa'); diff --git a/back/src/api/zikloa/services/zikloa.js b/back/src/api/zikloa/services/zikloa.js new file mode 100644 index 0000000..7b5d321 --- /dev/null +++ b/back/src/api/zikloa/services/zikloa.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * zikloa service + */ + +const { createCoreService } = require('@strapi/strapi').factories; + +module.exports = createCoreService('api::zikloa.zikloa'); diff --git a/back/src/components/bizi/elkarlana.json b/back/src/components/bizi/elkarlana.json new file mode 100644 index 0000000..91d8611 --- /dev/null +++ b/back/src/components/bizi/elkarlana.json @@ -0,0 +1,19 @@ +{ + "collectionName": "components_bizi_elkarlanas", + "info": { + "displayName": "elkarlana", + "icon": "handHeart", + "description": "" + }, + "options": {}, + "attributes": { + "harremana": { + "type": "string" + }, + "erakundeak": { + "type": "relation", + "relation": "oneToMany", + "target": "api::erakundea.erakundea" + } + } +} diff --git a/back/types/generated/components.d.ts b/back/types/generated/components.d.ts index fa67cd5..c892209 100644 --- a/back/types/generated/components.d.ts +++ b/back/types/generated/components.d.ts @@ -1,5 +1,22 @@ import type { Schema, Attribute } from '@strapi/strapi'; +export interface BiziElkarlana extends Schema.Component { + collectionName: 'components_bizi_elkarlanas'; + info: { + displayName: 'elkarlana'; + icon: 'handHeart'; + description: ''; + }; + attributes: { + harremana: Attribute.String; + erakundeak: Attribute.Relation< + 'bizi.elkarlana', + 'oneToMany', + 'api::erakundea.erakundea' + >; + }; +} + export interface KafetegiaAlergenoa extends Schema.Component { collectionName: 'components_kafetegia_alergenoas'; info: { @@ -119,6 +136,7 @@ export interface OrokorraHelbidea extends Schema.Component { declare module '@strapi/types' { export module Shared { export interface Components { + 'bizi.elkarlana': BiziElkarlana; 'kafetegia.alergenoa': KafetegiaAlergenoa; 'kafetegia.edaria': KafetegiaEdaria; 'kafetegia.izenburua': KafetegiaIzenburua; diff --git a/back/types/generated/contentTypes.d.ts b/back/types/generated/contentTypes.d.ts index e2416b0..43f3389 100644 --- a/back/types/generated/contentTypes.d.ts +++ b/back/types/generated/contentTypes.d.ts @@ -403,9 +403,12 @@ export interface PluginUploadFile extends Schema.CollectionType { folderPath: Attribute.String & Attribute.Required & Attribute.Private & - Attribute.SetMinMax<{ - min: 1; - }>; + Attribute.SetMinMax< + { + min: 1; + }, + number + >; createdAt: Attribute.DateTime; updatedAt: Attribute.DateTime; createdBy: Attribute.Relation< @@ -441,9 +444,12 @@ export interface PluginUploadFolder extends Schema.CollectionType { attributes: { name: Attribute.String & Attribute.Required & - Attribute.SetMinMax<{ - min: 1; - }>; + Attribute.SetMinMax< + { + min: 1; + }, + number + >; pathId: Attribute.Integer & Attribute.Required & Attribute.Unique; parent: Attribute.Relation< 'plugin::upload.folder', @@ -462,9 +468,12 @@ export interface PluginUploadFolder extends Schema.CollectionType { >; path: Attribute.String & Attribute.Required & - Attribute.SetMinMax<{ - min: 1; - }>; + Attribute.SetMinMax< + { + min: 1; + }, + number + >; createdAt: Attribute.DateTime; updatedAt: Attribute.DateTime; createdBy: Attribute.Relation< @@ -503,6 +512,12 @@ 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', @@ -551,11 +566,13 @@ export interface PluginContentReleasesReleaseAction 'morphToOne' >; contentType: Attribute.String & Attribute.Required; + locale: Attribute.String; release: Attribute.Relation< 'plugin::content-releases.release-action', 'manyToOne', 'plugin::content-releases.release' >; + isEntryValid: Attribute.Boolean; createdAt: Attribute.DateTime; updatedAt: Attribute.DateTime; createdBy: Attribute.Relation< @@ -595,10 +612,13 @@ export interface PluginI18NLocale extends Schema.CollectionType { }; attributes: { name: Attribute.String & - Attribute.SetMinMax<{ - min: 1; - max: 50; - }>; + Attribute.SetMinMax< + { + min: 1; + max: 50; + }, + number + >; code: Attribute.String & Attribute.Unique; createdAt: Attribute.DateTime; updatedAt: Attribute.DateTime; @@ -768,6 +788,107 @@ export interface PluginUsersPermissionsUser extends Schema.CollectionType { }; } +export interface ApiBiziBizi extends Schema.SingleType { + collectionName: 'bizis'; + info: { + singularName: 'bizi'; + pluralName: 'bizis'; + displayName: 'Bizi'; + }; + options: { + draftAndPublish: true; + }; + attributes: { + izenburua: Attribute.String & Attribute.Required; + deskribapena: Attribute.Text; + createdAt: Attribute.DateTime; + updatedAt: Attribute.DateTime; + publishedAt: Attribute.DateTime; + createdBy: Attribute.Relation<'api::bizi.bizi', 'oneToOne', 'admin::user'> & + Attribute.Private; + updatedBy: Attribute.Relation<'api::bizi.bizi', 'oneToOne', 'admin::user'> & + Attribute.Private; + }; +} + +export interface ApiEkintzaEkintza extends Schema.CollectionType { + collectionName: 'ekintzak'; + info: { + singularName: 'ekintza'; + pluralName: 'ekintzak'; + displayName: 'Ekintza'; + description: ''; + }; + options: { + draftAndPublish: true; + }; + attributes: { + izenburua: Attribute.String & Attribute.Required; + slug: Attribute.UID<'api::ekintza.ekintza', 'izenburua'> & + Attribute.Required; + hitzordua: Attribute.DateTime & Attribute.Required; + titularra: Attribute.Text; + elkarlana: Attribute.Component<'bizi.elkarlana', true>; + labakoUzta: Attribute.Boolean & + Attribute.Required & + Attribute.DefaultTo; + kartela: Attribute.Media; + zikloa: Attribute.Relation< + 'api::ekintza.ekintza', + 'manyToOne', + 'api::zikloa.zikloa' + >; + deskribapena: Attribute.RichText; + createdAt: Attribute.DateTime; + updatedAt: Attribute.DateTime; + publishedAt: Attribute.DateTime; + createdBy: Attribute.Relation< + 'api::ekintza.ekintza', + 'oneToOne', + 'admin::user' + > & + Attribute.Private; + updatedBy: Attribute.Relation< + 'api::ekintza.ekintza', + 'oneToOne', + 'admin::user' + > & + Attribute.Private; + }; +} + +export interface ApiErakundeaErakundea extends Schema.CollectionType { + collectionName: 'erakundeak'; + info: { + singularName: 'erakundea'; + pluralName: 'erakundeak'; + displayName: 'Erakundea'; + description: ''; + }; + options: { + draftAndPublish: false; + }; + attributes: { + izena: Attribute.String & Attribute.Required; + esteka: Attribute.String; + logoa: Attribute.Media; + createdAt: Attribute.DateTime; + updatedAt: Attribute.DateTime; + createdBy: Attribute.Relation< + 'api::erakundea.erakundea', + 'oneToOne', + 'admin::user' + > & + Attribute.Private; + updatedBy: Attribute.Relation< + 'api::erakundea.erakundea', + 'oneToOne', + 'admin::user' + > & + Attribute.Private; + }; +} + export interface ApiHasieraHasiera extends Schema.SingleType { collectionName: 'hasierak'; info: { @@ -900,6 +1021,44 @@ export interface ApiPribatutasunPolitikaPribatutasunPolitika }; } +export interface ApiZikloaZikloa extends Schema.CollectionType { + collectionName: 'zikloas'; + info: { + singularName: 'zikloa'; + pluralName: 'zikloas'; + displayName: 'Zikloa'; + description: ''; + }; + options: { + draftAndPublish: true; + }; + attributes: { + izena: Attribute.String & Attribute.Required; + deskribapena: Attribute.RichText; + slug: Attribute.UID<'api::zikloa.zikloa', 'izena'> & Attribute.Required; + ekintzak: Attribute.Relation< + 'api::zikloa.zikloa', + 'oneToMany', + 'api::ekintza.ekintza' + >; + createdAt: Attribute.DateTime; + updatedAt: Attribute.DateTime; + publishedAt: Attribute.DateTime; + createdBy: Attribute.Relation< + 'api::zikloa.zikloa', + 'oneToOne', + 'admin::user' + > & + Attribute.Private; + updatedBy: Attribute.Relation< + 'api::zikloa.zikloa', + 'oneToOne', + 'admin::user' + > & + Attribute.Private; + }; +} + declare module '@strapi/types' { export module Shared { export interface ContentTypes { @@ -918,10 +1077,14 @@ declare module '@strapi/types' { 'plugin::users-permissions.permission': PluginUsersPermissionsPermission; 'plugin::users-permissions.role': PluginUsersPermissionsRole; 'plugin::users-permissions.user': PluginUsersPermissionsUser; + 'api::bizi.bizi': ApiBiziBizi; + 'api::ekintza.ekintza': ApiEkintzaEkintza; + 'api::erakundea.erakundea': ApiErakundeaErakundea; 'api::hasiera.hasiera': ApiHasieraHasiera; 'api::kafetegia.kafetegia': ApiKafetegiaKafetegia; 'api::lege-oharra.lege-oharra': ApiLegeOharraLegeOharra; 'api::pribatutasun-politika.pribatutasun-politika': ApiPribatutasunPolitikaPribatutasunPolitika; + 'api::zikloa.zikloa': ApiZikloaZikloa; } } } diff --git a/front/gatsby-browser.tsx b/front/gatsby-browser.tsx index 34f472c..3516fe3 100644 --- a/front/gatsby-browser.tsx +++ b/front/gatsby-browser.tsx @@ -1 +1 @@ -import "./src/styles/cssConfig.scss" +import './src/styles/cssConfig.scss'; diff --git a/front/gatsby-config.js b/front/gatsby-config.js index 5eef418..229d2c7 100644 --- a/front/gatsby-config.js +++ b/front/gatsby-config.js @@ -10,20 +10,20 @@ module.exports = { resolve: 'gatsby-source-strapi-graphql', options: { apiURL: process.env.API_URL, - collectionTypes: [], + collectionTypes: ['ekintza', 'erakundea', 'zikloa'], singleTypes: [ 'hasiera', + 'bizi', 'kafetegia', 'lege-oharra', 'pribatutasun-politika', ], - contentTypes: [], // Enable/disable cache. cache: false, token: process.env.STRAPI_GRAPHQL_TOKEN, }, }, - 'gatsby-transformer-sharp', + 'gatsby-plugin-image', 'gatsby-plugin-sharp', { resolve: 'gatsby-plugin-react-svg', @@ -43,6 +43,11 @@ module.exports = { variants: ['400', '700'], fontDisplay: 'swap', }, + { + family: 'Abril Fatface', + variants: ['400'], + fontDisplay: 'swap', + }, ], }, }, diff --git a/front/package.json b/front/package.json index c4b31d0..5fc09c2 100644 --- a/front/package.json +++ b/front/package.json @@ -10,14 +10,15 @@ "main": "gatsby-config.js", "scripts": { "develop": "gatsby develop", - "start": "gatsby develop", + "preview": "ENABLE_GATSBY_REFRESH_ENDPOINT=true gatsby develop -H 0.0.0.0 -p 8000", + "start": "gatsby build && gatsby serve", "build": "gatsby build", "serve": "gatsby serve", "clean": "gatsby clean", "prettier": "prettier . --write" }, "dependencies": { - "@strapi/plugin-graphql": "^4.15.5", + "@strapi/plugin-graphql": "^4.24.0", "dayjs": "^1.11.10", "gatsby": "^5.12.11", "gatsby-plugin-image": "^3.12.3", diff --git a/front/src/domain/AtalaName.ts b/front/src/domain/AtalaName.ts new file mode 100644 index 0000000..e84507d --- /dev/null +++ b/front/src/domain/AtalaName.ts @@ -0,0 +1 @@ +export type AtalaName = 'hasiera' | 'kafetegia' | 'bizi'; diff --git a/front/src/domain/_valueObjects/Irudia.ts b/front/src/domain/_valueObjects/Irudia.ts new file mode 100644 index 0000000..dcefc39 --- /dev/null +++ b/front/src/domain/_valueObjects/Irudia.ts @@ -0,0 +1,15 @@ +interface Format { + url: string; + width: number; + height: number; +} + +export interface Irudia { + alternativeText?: string; + formats: { + thumbnail: Format; + small: Format; + medium: Format; + large: Format; + }; +} diff --git a/front/src/domain/_valueObjects/IsoDate.ts b/front/src/domain/_valueObjects/IsoDate.ts new file mode 100644 index 0000000..12289db --- /dev/null +++ b/front/src/domain/_valueObjects/IsoDate.ts @@ -0,0 +1 @@ +type IsoDate = string; diff --git a/front/src/domain/_valueObjects/Markdown.ts b/front/src/domain/_valueObjects/Markdown.ts new file mode 100644 index 0000000..906edbf --- /dev/null +++ b/front/src/domain/_valueObjects/Markdown.ts @@ -0,0 +1 @@ +export type Markdown = string; diff --git a/front/src/domain/bizi/BiziContent.ts b/front/src/domain/bizi/BiziContent.ts new file mode 100644 index 0000000..fdf50e6 --- /dev/null +++ b/front/src/domain/bizi/BiziContent.ts @@ -0,0 +1,4 @@ +export interface BiziContent { + izenburua: string; + deskribapena: string; +} diff --git a/front/src/domain/ekintza/EkintzaContent.ts b/front/src/domain/ekintza/EkintzaContent.ts new file mode 100644 index 0000000..d81f3b8 --- /dev/null +++ b/front/src/domain/ekintza/EkintzaContent.ts @@ -0,0 +1,13 @@ +import { Irudia } from '../_valueObjects/Irudia'; +import { Markdown } from '../_valueObjects/Markdown'; +import { ZikloaContent } from '../zikloa/ZikloaContent'; + +export interface EkintzaContent { + slug: string; + izenburua: string; + hitzordua: IsoDate; + titularra?: string; + deskribapena?: Markdown; + kartela?: Irudia; + zikloa?: Pick; +} diff --git a/front/src/domain/zikloa/ZikloaContent.ts b/front/src/domain/zikloa/ZikloaContent.ts new file mode 100644 index 0000000..608d62b --- /dev/null +++ b/front/src/domain/zikloa/ZikloaContent.ts @@ -0,0 +1,15 @@ +import { Markdown } from '../_valueObjects/Markdown'; +import { EkintzaContent } from '../ekintza/EkintzaContent'; + +export interface ZikloaContent { + slug: string; + izena: string; + deskribapena?: Markdown; + ekintzak: EkintzaContent[]; +} + +export function getLastEkintza(zikloa: ZikloaContent) { + return zikloa.ekintzak + .sort((a, b) => (a.hitzordua > b.hitzordua ? 1 : -1)) + .slice(-1)[0].hitzordua; +} diff --git a/front/src/pages/bizi/ekintzak/{strapiEkintza.slug}.tsx b/front/src/pages/bizi/ekintzak/{strapiEkintza.slug}.tsx new file mode 100644 index 0000000..1cb9c7f --- /dev/null +++ b/front/src/pages/bizi/ekintzak/{strapiEkintza.slug}.tsx @@ -0,0 +1,55 @@ +import React from 'react'; + +import { graphql, PageProps } from 'gatsby'; + +import { SEO } from '../../../components/SEO'; +import { EkintzaContent } from '../../../domain/ekintza/EkintzaContent'; +import { Ekintza } from '../../../views/Ekintza/Ekintza'; +import { NotFound } from '../../../views/NotFound'; + +interface QueryData { + strapiEkintza: EkintzaContent; +} + +const EkintzaPage: React.FC> = ({ location, data }) => { + const content = data.strapiEkintza; + + // TODO testeatu eta produkzioan jarri + if (process.env.NODE_ENV === 'production') { + return ; + } + + return ( + <> + + + + + ); +}; + +export const query = graphql` + fragment Ekintza on StrapiEkintza { + slug + izenburua + titularra + deskribapena + hitzordua + zikloa { + slug + izena + } + kartela { + alternativeText + formats + } + } + + query ($slug: String) { + strapiEkintza(slug: { eq: $slug }) { + ...Ekintza + } + } +`; + +export default EkintzaPage; diff --git a/front/src/pages/bizi/index.tsx b/front/src/pages/bizi/index.tsx new file mode 100644 index 0000000..61a8e2c --- /dev/null +++ b/front/src/pages/bizi/index.tsx @@ -0,0 +1,56 @@ +import React from 'react'; + +import { graphql, PageProps } from 'gatsby'; + +import { SEO } from '../../components/SEO'; +import { BiziContent } from '../../domain/bizi/BiziContent'; +import { EkintzaContent } from '../../domain/ekintza/EkintzaContent'; +import { ZikloaContent } from '../../domain/zikloa/ZikloaContent'; +import { Bizi } from '../../views/Bizi'; +import { NotFound } from '../../views/NotFound'; + +interface QueryData { + strapiBizi: BiziContent; + allStrapiEkintza: { nodes: EkintzaContent[] }; + allStrapiZikloa: { nodes: ZikloaContent[] }; +} + +const BiziPage: React.FC> = ({ location, data }) => { + const content = data.strapiBizi; + const ekintzak = data.allStrapiEkintza.nodes; + const zikloak = data.allStrapiZikloa.nodes; + + // TODO testeatu eta produkzioan jarri + if (process.env.NODE_ENV === 'production') { + return ; + } + + return ( + <> + + + + + ); +}; + +export const query = graphql` + { + strapiBizi { + deskribapena + izenburua + } + allStrapiEkintza(sort: { hitzordua: ASC }) { + nodes { + ...Ekintza + } + } + allStrapiZikloa { + nodes { + ...Zikloa + } + } + } +`; + +export default BiziPage; diff --git a/front/src/pages/bizi/zikloak/{strapiZikloa.slug}.tsx b/front/src/pages/bizi/zikloak/{strapiZikloa.slug}.tsx new file mode 100644 index 0000000..41d6f5b --- /dev/null +++ b/front/src/pages/bizi/zikloak/{strapiZikloa.slug}.tsx @@ -0,0 +1,48 @@ +import React from 'react'; + +import { graphql, PageProps } from 'gatsby'; + +import { SEO } from '../../../components/SEO'; +import { ZikloaContent } from '../../../domain/zikloa/ZikloaContent'; +import { NotFound } from '../../../views/NotFound'; +import { Zikloa } from '../../../views/Zikloa/Zikloa'; + +interface QueryData { + strapiZikloa: ZikloaContent; +} + +const ZikloaPage: React.FC> = ({ location, data }) => { + const content = data.strapiZikloa; + + // TODO testeatu eta produkzioan jarri + if (process.env.NODE_ENV === 'production') { + return ; + } + + return ( + <> + + + + + ); +}; + +export const query = graphql` + fragment Zikloa on StrapiZikloa { + slug + izena + deskribapena + ekintzak { + ...Ekintza + } + } + + query ($slug: String) { + strapiZikloa(slug: { eq: $slug }) { + ...Zikloa + } + } +`; + +export default ZikloaPage; diff --git a/front/src/styles/settings/colors.scss b/front/src/styles/settings/colors.scss index 9f417ed..5ead98b 100644 --- a/front/src/styles/settings/colors.scss +++ b/front/src/styles/settings/colors.scss @@ -5,4 +5,9 @@ --color-horia: #fdb201; --color-gorria: #fd3647; --color-zuria: #ffffff; + + --color-grisa-1: #474747; + --color-grisa-2: #707070; + --color-grisa-3: #999999; + --color-grisa-4: #c2c2c2; } diff --git a/front/src/utilities/dateUtils.ts b/front/src/utilities/dateUtils.ts new file mode 100644 index 0000000..65051f9 --- /dev/null +++ b/front/src/utilities/dateUtils.ts @@ -0,0 +1,19 @@ +import 'dayjs/locale/eu'; + +import dayjs from 'dayjs'; +import localizedFormat from 'dayjs/plugin/localizedFormat'; + +dayjs.extend(localizedFormat); +dayjs.locale('eu'); + +export function formatAbbreviatedDate(date: IsoDate) { + return dayjs(date).format('MMM D, dddd, LT[etan]'); +} + +export function formatLargeDate(date: IsoDate) { + return dayjs(date).format('LL, dddd, LT[etan]'); +} + +export function formatAbbreviatedDay(date: IsoDate) { + return dayjs(date).format('MMM D'); +} diff --git a/front/src/views/Bizi/Bizi.module.scss b/front/src/views/Bizi/Bizi.module.scss new file mode 100644 index 0000000..32d43bb --- /dev/null +++ b/front/src/views/Bizi/Bizi.module.scss @@ -0,0 +1,89 @@ +@import '../../styles/tools/mixins/font.scss'; +@import '../../styles/tools/mediaQueries.scss'; + +.wrapper { + padding-left: var(--size-small); + padding-right: var(--size-small); + padding-top: var(--size-huge); + margin-bottom: var(--size-huge); + + @media #{$fromDesktop} { + display: grid; + grid-template-columns: 4fr 2fr; + gap: var(--size-huge); + + padding-left: var(--size-huge); + padding-right: var(--size-huge); + } +} + +.section { + @media #{$fromDesktop} { + position: relative; + + &:hover { + & > .title { + transform: translateY(-200%); + filter: none; + } + } + } +} + +.title { + font-family: 'Abril Fatface', sans-serif; + font-size: clamp(2rem, 4.2dvw, 5rem); + color: var(--color-grisa-3); + + z-index: 10; + mix-blend-mode: difference; + + @media #{$fromDesktop} { + position: absolute; + top: 0; + left: 0; + + transition: transform 0.3s ease-in-out; + transform: translateX(-50%) rotate(-90deg) translateX(-50%) + translateY(-120%); + } +} + +.zikloaCardList { + padding: var(--size-base); + display: grid; + gap: var(--size-large); +} + +.card { + position: relative; +} + +.cardLink { + font-family: 'Abril Fatface', sans-serif; + @include largeFont; + + transition: color 0.4s ease; + + &:hover { + color: var(--color-morea); + } + + &::after { + position: absolute; + content: ''; + left: 0; + top: 0; + right: 0; + bottom: 0; + } +} + +.deskribapena { + @include baseFont; + font-weight: var(--font-weight-regular); +} + +.cardHitzordua { + @include baseFont; +} diff --git a/front/src/views/Bizi/Bizi.tsx b/front/src/views/Bizi/Bizi.tsx new file mode 100644 index 0000000..331ffa2 --- /dev/null +++ b/front/src/views/Bizi/Bizi.tsx @@ -0,0 +1,77 @@ +import React from 'react'; +import ReactMarkdown from 'react-markdown'; + +import { Link } from 'gatsby'; + +import { BiziContent } from '../../domain/bizi/BiziContent'; +import { EkintzaContent } from '../../domain/ekintza/EkintzaContent'; +import { + getLastEkintza, + ZikloaContent, +} from '../../domain/zikloa/ZikloaContent'; +import { formatAbbreviatedDay } from '../../utilities/dateUtils'; +import { EkintzaSnippetList } from '../components/EkintzaSnippetList/EkintzaSnippetList'; +import { Hero } from '../components/Hero'; +import { Layout } from '../components/Layout'; +import { Oina } from '../components/Oina'; +import * as styles from './Bizi.module.scss'; + +interface Props { + content: BiziContent; + ekintzak: EkintzaContent[]; + zikloak: ZikloaContent[]; +} + +export const Bizi: React.FC = ({ content, ekintzak, zikloak }) => { + const { izenburua, deskribapena } = content; + + const ekintzakToShow = ekintzak.filter( + ekintza => new Date(ekintza.hitzordua) >= new Date(), + ); + const zikloakToShow = zikloak.filter( + zikloa => new Date(getLastEkintza(zikloa)) >= new Date(), + ); + + return ( + + + +
+
+

ekintzak

+ +
+ + {zikloakToShow.length > 0 && ( +
+

zikloak

+
    + {zikloakToShow.map(zikloa => ( +
  • +

    + {formatAbbreviatedDay(getLastEkintza(zikloa))} arte +

    + + + {zikloa.izena} + + + {zikloa.deskribapena && ( + + {zikloa.deskribapena} + + )} +
  • + ))} +
+
+ )} +
+ + +
+ ); +}; diff --git a/front/src/views/Bizi/index.ts b/front/src/views/Bizi/index.ts new file mode 100644 index 0000000..d7b02f8 --- /dev/null +++ b/front/src/views/Bizi/index.ts @@ -0,0 +1 @@ +export { Bizi } from './Bizi'; diff --git a/front/src/views/Ekintza/Ekintza.module.scss b/front/src/views/Ekintza/Ekintza.module.scss new file mode 100644 index 0000000..40024f8 --- /dev/null +++ b/front/src/views/Ekintza/Ekintza.module.scss @@ -0,0 +1,103 @@ +@import '../../styles/tools/mixins/font.scss'; +@import '../../styles/tools/mediaQueries.scss'; + +.wrapper { + display: flex; + flex-direction: column-reverse; + padding: var(--size-base) var(--size-small) var(--size-base) var(--size-small); + + @media #{$fromTablet} { + width: 100%; + display: grid; + grid-template-columns: 2fr 1fr; + gap: var(--size-base); + padding: var(--size-huge) var(--size-base) var(--size-base) var(--size-base); + } +} + +.kartela { + width: 56%; + height: auto; + margin-bottom: var(--size-base); + + @media #{$fromTablet} { + width: 100%; + min-width: 360px; + height: auto; + } +} + +.izenburuWrapper { + display: flex; + flex-direction: column; + margin-bottom: var(--size-base); +} + +.hitzordua { + margin-bottom: var(--size-base); + + @include largeFont; + color: var(--color-grisa-1); +} + +.izenburua { + margin-bottom: var(--size-base); + + font-family: 'Abril Fatface', sans-serif; + font-size: clamp(2rem, 4.2dvw, 5rem); + line-height: 125%; +} + +.titularra { + @include hugeFont; + + &:not(:last-child) { + margin-bottom: var(--size-base); + } +} + +.deskribapena { + padding-top: var(--size-base); + + @include largeFont; + font-weight: var(--font-weight-regular); + + border-top: 3px solid var(--color-grisa-3); + + p:not(:last-child) { + margin-bottom: var(--size-base); + } +} + +.zikloa { + display: flex; + align-items: center; + margin-bottom: var(--size-small); + width: fit-content; + + @include baseFont; + text-decoration: underline; + + transition: color 0.3s ease; + + .gezia { + transition: transform 0.3s ease; + } + + &:hover { + color: var(--color-morea); + + .gezia { + transform: translateX(var(--size-small)); + } + } + + &:visited, + &:link { + text-decoration: underline; + } +} + +.gezia { + height: 1rem; +} diff --git a/front/src/views/Ekintza/Ekintza.tsx b/front/src/views/Ekintza/Ekintza.tsx new file mode 100644 index 0000000..b055638 --- /dev/null +++ b/front/src/views/Ekintza/Ekintza.tsx @@ -0,0 +1,73 @@ +import React from 'react'; +import ReactMarkdown from 'react-markdown'; + +import { Link } from 'gatsby'; + +import Gezia from '../../assets/gezia.svg'; +import { EkintzaContent } from '../../domain/ekintza/EkintzaContent'; +import { formatLargeDate } from '../../utilities/dateUtils'; +import { Gainburua } from '../components/Gainburua/Gainburua'; +import { Layout } from '../components/Layout'; +import { Oina } from '../components/Oina'; +import * as styles from './Ekintza.module.scss'; + +interface Props { + content: EkintzaContent; +} + +export const Ekintza: React.FC = ({ content }) => { + const { izenburua, kartela, titularra, hitzordua, deskribapena, zikloa } = + content; + + return ( + + + +
+
+ {zikloa && ( + + {zikloa.izena}{' '} + + + )} +

{formatLargeDate(hitzordua)}

+

{izenburua}

+

{titularra}

+ + {deskribapena && ( + + {deskribapena} + + )} +
+ + {kartela && ( + + )} +
+ + +
+ ); +}; diff --git a/front/src/views/Ekintza/index.ts b/front/src/views/Ekintza/index.ts new file mode 100644 index 0000000..e69de29 diff --git a/front/src/views/Hasiera/Hasiera.tsx b/front/src/views/Hasiera/Hasiera.tsx index c87e153..4c66a75 100644 --- a/front/src/views/Hasiera/Hasiera.tsx +++ b/front/src/views/Hasiera/Hasiera.tsx @@ -4,7 +4,7 @@ import ReactMarkdown from 'react-markdown'; import Gezia from '../../assets/gezia.svg'; import { HasieraContent } from '../../domain/hasiera/HasieraContent'; import { Container } from '../components/Container'; -import { Gainburua } from '../components/Gainburua'; +import { Hero } from '../components/Hero'; import { Oina } from '../components/Oina'; import * as styles from './Hasiera.module.scss'; @@ -16,11 +16,7 @@ export const Hasiera: React.FC = ({ content }) => { const { izenburua, deskribapena, edukia } = content; return ( <> - +
diff --git a/front/src/views/Kafetegia/Kafetegia.module.scss b/front/src/views/Kafetegia/Kafetegia.module.scss index 055c757..557ee00 100644 --- a/front/src/views/Kafetegia/Kafetegia.module.scss +++ b/front/src/views/Kafetegia/Kafetegia.module.scss @@ -32,6 +32,7 @@ text-align: right; vertical-align: bottom; + font-family: 'Abril Fatface', serif; @include gargantuanFont; &:after { diff --git a/front/src/views/Kafetegia/Kafetegia.tsx b/front/src/views/Kafetegia/Kafetegia.tsx index 6d00e21..d300a69 100644 --- a/front/src/views/Kafetegia/Kafetegia.tsx +++ b/front/src/views/Kafetegia/Kafetegia.tsx @@ -3,23 +3,26 @@ import React from 'react'; import { produktuaFactory } from '../../domain/kafetegia/factories/produktuaFactory'; import { KafetegiaContent } from '../../domain/kafetegia/KafetegiaContent'; import { Container } from '../components/Container'; -import { Gainburua } from '../components/Gainburua'; +import { Hero } from '../components/Hero'; import { Oina } from '../components/Oina'; import { ProduktuZerrenda } from './components/ProduktuZerrenda'; import * as styles from './Kafetegia.module.scss'; -export const Kafetegia: React.FC<{ content: KafetegiaContent }> = ({ - content, -}) => { +interface Props { + content: KafetegiaContent; +} + +export const Kafetegia: React.FC = ({ content }) => { const { izenburua, deskribapena, menua } = content; - // oraingoz menuak alergenorik ez duenez, alergeno legenda ezkutatuko dugu. - // AlergenoLegenda konponentea sortuta dago, baina ez dugu erabiltzen - // performance arrazoiengatik - + /** + * oraingoz menuak alergenorik ez duenez, alergeno legenda ezkutatuko dugu. + * AlergenoLegenda konponentea sortuta dago, baina ez dugu erabiltzen + * performance arrazoiengatik + */ return ( <> - ( <> diff --git a/front/src/views/RegularPage/RegularPage.tsx b/front/src/views/RegularPage/RegularPage.tsx index 56f5257..62ee80d 100644 --- a/front/src/views/RegularPage/RegularPage.tsx +++ b/front/src/views/RegularPage/RegularPage.tsx @@ -5,7 +5,7 @@ import remarkGfm from 'remark-gfm'; import { RegularPageContent } from '../../domain/basicPage/RegularPageContent'; import { Container } from '../components/Container'; -import { Gainburua } from '../components/Gainburua'; +import { Gainburua } from '../components/Gainburua/Gainburua'; import { Oina } from '../components/Oina'; import * as styles from './RegularPage.module.scss'; diff --git a/front/src/views/Zikloa/Zikloa.module.scss b/front/src/views/Zikloa/Zikloa.module.scss new file mode 100644 index 0000000..11acc27 --- /dev/null +++ b/front/src/views/Zikloa/Zikloa.module.scss @@ -0,0 +1,22 @@ +@import '../../styles/tools/mixins/font.scss'; + +.wrapper { + padding: var(--size-huge) var(--size-base) var(--size-base) var(--size-base); +} + +.izenburua { + margin-bottom: var(--size-base); + + font-family: 'Abril Fatface', sans-serif; + font-size: clamp(2rem, 4.2dvw, 5rem); + line-height: 125%; +} + +.deskribapena { + @include hugeFont; + font-weight: var(--font-weight-regular); + + &:not(:last-child) { + margin-bottom: var(--size-base); + } +} diff --git a/front/src/views/Zikloa/Zikloa.tsx b/front/src/views/Zikloa/Zikloa.tsx new file mode 100644 index 0000000..cf6a06c --- /dev/null +++ b/front/src/views/Zikloa/Zikloa.tsx @@ -0,0 +1,37 @@ +import React from 'react'; +import ReactMarkdown from 'react-markdown'; + +import { ZikloaContent } from '../../domain/zikloa/ZikloaContent'; +import { EkintzaSnippetList } from '../components/EkintzaSnippetList'; +import { Gainburua } from '../components/Gainburua/Gainburua'; +import { Layout } from '../components/Layout'; +import { Oina } from '../components/Oina'; +import * as styles from './Zikloa.module.scss'; + +interface Props { + content: ZikloaContent; +} + +export const Zikloa: React.FC = ({ content }) => { + const { izena, ekintzak, deskribapena } = content; + + return ( + + + +
+

{izena}

+ + {deskribapena && ( + + {deskribapena} + + )} + + +
+ + +
+ ); +}; diff --git a/front/src/views/Zikloa/index.ts b/front/src/views/Zikloa/index.ts new file mode 100644 index 0000000..e69de29 diff --git a/front/src/views/components/Container/Container.tsx b/front/src/views/components/Container/Container.tsx index eac55cd..197bf85 100644 --- a/front/src/views/components/Container/Container.tsx +++ b/front/src/views/components/Container/Container.tsx @@ -2,6 +2,15 @@ import React, { PropsWithChildren } from 'react'; import * as styles from './Container.module.scss'; -export const Container: React.FC = ({ children }) => ( -
{children}
+interface Props { + id?: string; +} + +export const Container: React.FC> = ({ + children, + id, +}) => ( +
+ {children} +
); diff --git a/front/src/views/components/EkintzaSnippetList/EkintzaSnippetList.module.scss b/front/src/views/components/EkintzaSnippetList/EkintzaSnippetList.module.scss new file mode 100644 index 0000000..9abd730 --- /dev/null +++ b/front/src/views/components/EkintzaSnippetList/EkintzaSnippetList.module.scss @@ -0,0 +1,73 @@ +@import '../../../styles/tools/mixins/font.scss'; +@import '../../../styles/tools/mediaQueries.scss'; + +.card { + position: relative; + + @media #{$fromTablet} { + display: flex; + flex-direction: row-reverse; + justify-content: flex-end; + gap: var(--size-base); + } +} + +.ekintzaInformation { + display: flex; + flex-direction: column; +} + +.ekintzaCardList { + padding-top: var(--size-base); + padding-bottom: var(--size-base); + display: grid; + gap: var(--size-large); +} + +.cardHeadline { + @include largeFont; + font-weight: var(--font-weight-regular); + + order: 3; +} + +.kartela { + height: 9rem; + width: auto; + justify-self: end; +} + +.cardLink { + margin-bottom: var(--size-base); + + font-family: 'Abril Fatface', sans-serif; + @include gargantuanFont; + + order: 2; + transition: color 0.4s ease; + + &:hover { + color: var(--color-morea); + } + + &::after { + position: absolute; + content: ''; + left: 0; + top: 0; + right: 0; + bottom: 0; + } + + &:focus-visible { + &::after { + outline: 2px solid var(--color-morea); + } + } +} + +.cardHitzordua { + @include largeFont; + + order: 1; +} diff --git a/front/src/views/components/EkintzaSnippetList/EkintzaSnippetList.tsx b/front/src/views/components/EkintzaSnippetList/EkintzaSnippetList.tsx new file mode 100644 index 0000000..aceafea --- /dev/null +++ b/front/src/views/components/EkintzaSnippetList/EkintzaSnippetList.tsx @@ -0,0 +1,51 @@ +import React from 'react'; +import ReactMarkdown from 'react-markdown'; + +import { Link } from 'gatsby'; + +import { EkintzaContent } from '../../../domain/ekintza/EkintzaContent'; +import { formatAbbreviatedDate } from '../../../utilities/dateUtils'; +import * as styles from './EkintzaSnippetList.module.scss'; + +interface Props { + ekintzak: EkintzaContent[]; +} + +export const EkintzaSnippetList: React.FC = ({ ekintzak }) => { + return ( +
    + {ekintzak.map(ekintza => ( +
  • +
    + + {ekintza.izenburua} + + + {ekintza.titularra && ( + + {ekintza.titularra} + + )} + +

    + {formatAbbreviatedDate(ekintza.hitzordua)} +

    +
    + + {ekintza.kartela && ( + {ekintza.kartela.alternativeText} + )} +
  • + ))} +
+ ); +}; diff --git a/front/src/views/components/EkintzaSnippetList/index.ts b/front/src/views/components/EkintzaSnippetList/index.ts new file mode 100644 index 0000000..3beb07c --- /dev/null +++ b/front/src/views/components/EkintzaSnippetList/index.ts @@ -0,0 +1 @@ +export { EkintzaSnippetList } from './EkintzaSnippetList'; diff --git a/front/src/views/components/Gainburua/AtalaName.ts b/front/src/views/components/Gainburua/AtalaName.ts deleted file mode 100644 index b0b3399..0000000 --- a/front/src/views/components/Gainburua/AtalaName.ts +++ /dev/null @@ -1 +0,0 @@ -export type AtalaName = 'hasiera' | 'kafetegia'; diff --git a/front/src/views/components/Gainburua/Gainburua.module.scss b/front/src/views/components/Gainburua/Gainburua.module.scss index 32360b6..682ab86 100644 --- a/front/src/views/components/Gainburua/Gainburua.module.scss +++ b/front/src/views/components/Gainburua/Gainburua.module.scss @@ -2,39 +2,6 @@ @import '../../../styles/tools/mixins/font.scss'; @import '../../../styles/tools/mixins/container.scss'; -.geziaWrapper { - display: none; - - @media #{$fromDesktop} { - display: flex; - justify-content: flex-end; - } -} - -.geziaLogo { - animation-duration: 2s; - animation-iteration-count: infinite; - animation-name: bounce-2; - animation-timing-function: ease; - - @keyframes bounce-2 { - 0% { - transform: rotate(90deg) translateX(0); - } - 50% { - transform: rotate(90deg) translateX(var(--size-base)); - } - 100% { - transform: rotate(90deg) translateX(0); - } - } -} - -.nagusia { - flex-grow: 1; - @include container; -} - .mugikorWrapper { display: grid; grid-template-columns: repeat(3, 1fr); @@ -89,11 +56,23 @@ } } +.bizi { + --color: var(--color-beltza); + --hover-color: var(--color-gorria); + --background-color: var(--color-urdina); + + @media #{$fromDesktop} { + min-height: 100dvh; + } +} + .logoWrapper { width: var(--size-huge); } .logo { + display: block; + path { transition: fill 0.4s ease; fill: var(--color); @@ -113,7 +92,7 @@ justify-content: center; @media #{$fromTablet} { - padding: var(--size-large); + padding: var(--size-mini) var(--size-large); } @media #{$fromDesktop} { @@ -139,17 +118,11 @@ margin-bottom: var(--size-large); } -.marra { - /* altuera erabiliko den letraren berdina da */ - height: #{toRem(41.83)}; - flex-grow: 1; - box-shadow: inset 0px -3px 0px 0px var(--color); - margin-right: var(--size-tiny); -} - .izenburua { text-align: right; vertical-align: bottom; + font-family: 'Abril Fatface', serif; + letter-spacing: 0.1rem; &:after { content: '.'; @@ -175,7 +148,7 @@ } } - &:focus { + &:focus-visible { outline: 3px solid var(--hover-color); } @@ -193,6 +166,7 @@ .desktopNavigazioaWrapper { display: none; + align-self: flex-end; @media #{$fromDesktop} { display: initial; diff --git a/front/src/views/components/Gainburua/Gainburua.tsx b/front/src/views/components/Gainburua/Gainburua.tsx index a2bf778..14a7dc5 100644 --- a/front/src/views/components/Gainburua/Gainburua.tsx +++ b/front/src/views/components/Gainburua/Gainburua.tsx @@ -1,32 +1,19 @@ import React from 'react'; -import Gezia from '../../../assets/gezia.svg'; -import { classNames } from '../../../utilities/classnames'; +import { AtalaName } from '../../../domain/AtalaName'; import Logo from './assets/logo.svg'; -import { AtalaName } from './AtalaName'; import { DesktopNabigazioa } from './components/DesktopNabigazioa'; import { KontaktuDatuak } from './components/KontaktuDatuak'; import { MugikorNabigazioa } from './components/MugikorNabigazioa'; import * as styles from './Gainburua.module.scss'; interface Props { - izenburua?: string; - deskribapena?: string; atala?: AtalaName; } -const atalaClassname: { [key in AtalaName]: string } = { - hasiera: styles.hasiera, - kafetegia: styles.kafetegia, -}; - -export const Gainburua: React.FC = ({ - izenburua, - deskribapena, - atala, -}) => { +export const Gainburua: React.FC = ({ atala }) => { return ( -
+
@@ -34,36 +21,17 @@ export const Gainburua: React.FC = ({
+
+ +
+
+ +
+
- - {deskribapena && ( -
-

{deskribapena}

- -
-
-

{izenburua}

-
- - -
- )} - -
- -
- -
- -
); }; diff --git a/front/src/views/components/Gainburua/components/DesktopNabigazioa/DesktopNabigazioa.module.scss b/front/src/views/components/Gainburua/components/DesktopNabigazioa/DesktopNabigazioa.module.scss index 3e2cae4..c147d5d 100644 --- a/front/src/views/components/Gainburua/components/DesktopNabigazioa/DesktopNabigazioa.module.scss +++ b/front/src/views/components/Gainburua/components/DesktopNabigazioa/DesktopNabigazioa.module.scss @@ -1,7 +1,6 @@ .nabigazioa { display: flex; justify-content: center; - padding-bottom: var(--size-tiny); } .estekaZerrenda { @@ -10,7 +9,9 @@ list-style-type: none; } -.esteka { +.gainburuLink { + display: inline-block; + position: relative; padding: var(--size-small); color: var(--color); @@ -20,13 +21,12 @@ &:hover { color: var(--hover-color); } + + &:focus-visible { + outline: 3px solid var(--hover-color); + } } .active { border-bottom: 3px solid var(--color); } -.gainburuLink { - &:focus { - outline: 3px solid var(--hover-color); - } -} diff --git a/front/src/views/components/Gainburua/components/DesktopNabigazioa/DesktopNabigazioa.tsx b/front/src/views/components/Gainburua/components/DesktopNabigazioa/DesktopNabigazioa.tsx index 4816499..9121c16 100644 --- a/front/src/views/components/Gainburua/components/DesktopNabigazioa/DesktopNabigazioa.tsx +++ b/front/src/views/components/Gainburua/components/DesktopNabigazioa/DesktopNabigazioa.tsx @@ -5,7 +5,7 @@ import { Link } from 'gatsby'; import { classNames } from '../../../../../utilities/classnames'; import * as styles from './DesktopNabigazioa.module.scss'; -import type { AtalaName } from '../../AtalaName'; +import type { AtalaName } from '../../../../../domain/AtalaName'; interface Props { atala?: AtalaName; } @@ -14,24 +14,34 @@ export const DesktopNabigazioa: React.FC = ({ atala }) => { return (