feat: call to action paragraph-a sortzen du
This commit is contained in:
@@ -27,8 +27,8 @@
|
|||||||
"type": "dynamiczone",
|
"type": "dynamiczone",
|
||||||
"components": [
|
"components": [
|
||||||
"paragraph.testua",
|
"paragraph.testua",
|
||||||
"paragraph.youtube",
|
"paragraph.irudia",
|
||||||
"paragraph.irudia"
|
"paragraph.call-to-action"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
19
back/src/components/paragraph/call-to-action.json
Normal file
19
back/src/components/paragraph/call-to-action.json
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"collectionName": "components_paragraph_call_to_actions",
|
||||||
|
"info": {
|
||||||
|
"displayName": "call to action",
|
||||||
|
"icon": "rocket"
|
||||||
|
},
|
||||||
|
"options": {},
|
||||||
|
"attributes": {
|
||||||
|
"url": {
|
||||||
|
"type": "string",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"label": {
|
||||||
|
"type": "string",
|
||||||
|
"required": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"config": {}
|
||||||
|
}
|
||||||
13
back/types/generated/components.d.ts
vendored
13
back/types/generated/components.d.ts
vendored
@@ -89,6 +89,18 @@ export interface HasieraUrl extends Struct.ComponentSchema {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ParagraphCallToAction extends Struct.ComponentSchema {
|
||||||
|
collectionName: 'components_paragraph_call_to_actions';
|
||||||
|
info: {
|
||||||
|
displayName: 'call to action';
|
||||||
|
icon: 'rocket';
|
||||||
|
};
|
||||||
|
attributes: {
|
||||||
|
label: Schema.Attribute.String & Schema.Attribute.Required;
|
||||||
|
url: Schema.Attribute.String & Schema.Attribute.Required;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export interface ParagraphIrudia extends Struct.ComponentSchema {
|
export interface ParagraphIrudia extends Struct.ComponentSchema {
|
||||||
collectionName: 'components_paragraph_irudias';
|
collectionName: 'components_paragraph_irudias';
|
||||||
info: {
|
info: {
|
||||||
@@ -135,6 +147,7 @@ declare module '@strapi/strapi' {
|
|||||||
'hasiera.parte-hartu': HasieraParteHartu;
|
'hasiera.parte-hartu': HasieraParteHartu;
|
||||||
'hasiera.parte-hartzea': HasieraParteHartzea;
|
'hasiera.parte-hartzea': HasieraParteHartzea;
|
||||||
'hasiera.url': HasieraUrl;
|
'hasiera.url': HasieraUrl;
|
||||||
|
'paragraph.call-to-action': ParagraphCallToAction;
|
||||||
'paragraph.irudia': ParagraphIrudia;
|
'paragraph.irudia': ParagraphIrudia;
|
||||||
'paragraph.testua': ParagraphTestua;
|
'paragraph.testua': ParagraphTestua;
|
||||||
'paragraph.youtube': ParagraphYoutube;
|
'paragraph.youtube': ParagraphYoutube;
|
||||||
|
|||||||
2
back/types/generated/contentTypes.d.ts
vendored
2
back/types/generated/contentTypes.d.ts
vendored
@@ -495,7 +495,7 @@ export interface ApiOrriBasikoaOrriBasikoa extends Struct.CollectionTypeSchema {
|
|||||||
Schema.Attribute.Private;
|
Schema.Attribute.Private;
|
||||||
deskribapena: Schema.Attribute.Text;
|
deskribapena: Schema.Attribute.Text;
|
||||||
edukiLibrea: Schema.Attribute.DynamicZone<
|
edukiLibrea: Schema.Attribute.DynamicZone<
|
||||||
['paragraph.testua', 'paragraph.youtube', 'paragraph.irudia']
|
['paragraph.testua', 'paragraph.irudia', 'paragraph.call-to-action']
|
||||||
>;
|
>;
|
||||||
izenburua: Schema.Attribute.String & Schema.Attribute.Required;
|
izenburua: Schema.Attribute.String & Schema.Attribute.Required;
|
||||||
locale: Schema.Attribute.String & Schema.Attribute.Private;
|
locale: Schema.Attribute.String & Schema.Attribute.Private;
|
||||||
|
|||||||
@@ -118,6 +118,12 @@ const orriBasikoak = defineCollection({
|
|||||||
formats
|
formats
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
... on ComponentParagraphCallToAction {
|
||||||
|
type: __typename
|
||||||
|
id
|
||||||
|
url
|
||||||
|
label
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,17 @@ interface ParagraphTestua {
|
|||||||
testua: Markdown;
|
testua: Markdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Paragraph = ParagraphTestua | ParagraphIrudia;
|
interface ParagraphCallToAction {
|
||||||
|
type: "ComponentParagraphCallToAction";
|
||||||
|
id: string;
|
||||||
|
url: string;
|
||||||
|
label: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type Paragraph =
|
||||||
|
| ParagraphTestua
|
||||||
|
| ParagraphIrudia
|
||||||
|
| ParagraphCallToAction;
|
||||||
|
|
||||||
export interface OrriBasikoa {
|
export interface OrriBasikoa {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
import type { Paragraph } from "models/OrriBasikoa";
|
import type { Paragraph } from "models/OrriBasikoa";
|
||||||
import ParagraphIrudia from "./ParagraphIrudia.astro";
|
import ParagraphIrudia from "./ParagraphIrudia.astro";
|
||||||
import ParagraphTestua from "./ParagraphTestua.astro";
|
import ParagraphTestua from "./ParagraphTestua.astro";
|
||||||
|
import ParagraphCallToAction from "./ParagraphCallToAction.astro";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
paragraph: Paragraph;
|
paragraph: Paragraph;
|
||||||
@@ -17,6 +18,12 @@ const { paragraph } = Astro.props;
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
paragraph.type === "ComponentParagraphCallToAction" && (
|
||||||
|
<ParagraphCallToAction url={paragraph.url} label={paragraph.label} />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
paragraph.type === "ComponentParagraphTestua" && (
|
paragraph.type === "ComponentParagraphTestua" && (
|
||||||
<ParagraphTestua testua={paragraph.testua} />
|
<ParagraphTestua testua={paragraph.testua} />
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
---
|
||||||
|
interface Props {
|
||||||
|
url: string;
|
||||||
|
label: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { url, label } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<a href={url}>{label}</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
@use "../../../style/tools/mediaQueries.scss";
|
||||||
|
@use "../../../style/tools/toDVW.scss";
|
||||||
|
@use "../../../style/mixins/displayFonts.scss";
|
||||||
|
|
||||||
|
div {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
display: inline-block;
|
||||||
|
padding: var(--space-04-mobile) var(--space-06-mobile);
|
||||||
|
|
||||||
|
border-radius: var(--space-06-mobile);
|
||||||
|
background-color: var(--gorria);
|
||||||
|
text-decoration: none;
|
||||||
|
color: var(--zuria);
|
||||||
|
|
||||||
|
transition:
|
||||||
|
background-color 0.3s ease,
|
||||||
|
color 0.3s ease;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: var(--gorria);
|
||||||
|
background-color: var(--zuria);
|
||||||
|
}
|
||||||
|
|
||||||
|
@include displayFonts.display6;
|
||||||
|
@include mediaQueries.aboveTablet {
|
||||||
|
border-radius: var(--space-06-desktop);
|
||||||
|
padding: var(--space-04-desktop) var(--space-06-desktop);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user