Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge dev into production #2730

Merged
merged 38 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
7d786c5
creating UI for side banner
TalBenAvi Mar 18, 2024
6cf338e
editing size to use just base and lg
TalBenAvi Mar 18, 2024
f6df7f2
adding cms to side sticky banner
TalBenAvi Mar 20, 2024
66049a6
fixing location in blocks
TalBenAvi Mar 20, 2024
87ceebd
delete unused text
TalBenAvi Mar 20, 2024
f370816
adding gtm event
TalBenAvi Mar 20, 2024
b6fd8fb
check changes in the build
TalBenAvi Mar 21, 2024
d4dba53
update page
TalBenAvi Mar 21, 2024
9799d3e
adding things
TalBenAvi Mar 21, 2024
a178a86
fixing the data issue
TalBenAvi Mar 21, 2024
235c48f
deleting unused code
TalBenAvi Mar 21, 2024
ce0b0bb
delete unused code
TalBenAvi Mar 25, 2024
beca86b
delete unused code
TalBenAvi Mar 25, 2024
48a74a1
remove unused code
TalBenAvi Mar 25, 2024
c6c2820
upload changes
TalBenAvi Mar 25, 2024
3d2a24d
fix postPage
TalBenAvi Mar 25, 2024
29e9817
change files names
TalBenAvi Mar 26, 2024
16da690
fixing stickySidebar
TalBenAvi Mar 26, 2024
5d985e5
delete console.log
TalBenAvi Mar 26, 2024
a498e1a
Merge branch 'dev' into Blog-posts-latests-updates-side-banner
TalBenAvi Mar 28, 2024
0e3b277
fixing comments
TalBenAvi Mar 28, 2024
fec972f
Merge branch 'dev' into Blog-posts-latests-updates-side-banner
TalBenAvi Mar 28, 2024
a3ae889
fix id error.
TalBenAvi Mar 31, 2024
9139efd
fixing UI
TalBenAvi Apr 1, 2024
110425b
changing gtmEvent to generic function
TalBenAvi Apr 1, 2024
c8ec3be
changing gtm function location
TalBenAvi Apr 1, 2024
b6348c4
fix comments
TalBenAvi Apr 1, 2024
3caca4d
return ()
TalBenAvi Apr 1, 2024
9ec71e3
fixing LatestAnnouncement layout
TalBenAvi Apr 1, 2024
bb472a3
change images for demonstration
TalBenAvi Apr 1, 2024
4f4bd4a
fixing issues with responsiveness
TalBenAvi Apr 1, 2024
6709f83
update UI
TalBenAvi Apr 2, 2024
6f0199c
Merge branch 'dev' into Blog-posts-latests-updates-side-banner
TalBenAvi Apr 2, 2024
b7fa9f4
update UI
TalBenAvi Apr 2, 2024
59e29fa
push ui changes
TalBenAvi Apr 2, 2024
c473967
fixing ui
TalBenAvi Apr 2, 2024
bcb99c1
fix Icons to be closer to the image
TalBenAvi Apr 2, 2024
9d550d0
Merge pull request #2687 from starknet-io/Blog-posts-latests-updates-…
TalBenAvi Apr 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions _data/settings/latest-announcements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- isActive: true
image: https://www.starknet.io/assets/final-.jpeg
text: What are onramps and cross rollup bridges?
buttonText: See more
buttonLink: /
- isActive: true
image: https://www.starknet.io/assets/guide-image-3-.jpg
text: What are onramps and cross rollup bridges?
buttonText: See more
buttonLink: /
19 changes: 19 additions & 0 deletions workspaces/cms-config/src/blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,25 @@ export const topLevelBlocks = [
},
],
},
{
name: "side_sticky_banner",
label: "Side Sticky Banner",
widget: "object",
fields: [
{
name: "blocks",
label: "Blocks",
widget: "list",
types: [...blocks, flexLayout],
default: [],
},
{
name: "isActive",
widget: "boolean",
default: false,
},
],
},
flexLayout,
...blocks,
] satisfies CmsFieldList["types"];
2 changes: 1 addition & 1 deletion workspaces/cms-config/src/collections/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ export const collections: CmsConfig["collections"] = [
SEOCollectionConfig,
roadmapPostsCollectionConfig,
roadmapVersionsCollectionConfig,
announcementsCollectionConfig
announcementsCollectionConfig,
];
98 changes: 69 additions & 29 deletions workspaces/cms-config/src/collections/settings.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { linkFields } from "../blocks";
import { CmsCollection } from "../types";


const permissionOptions = [
{
label: "All",
Expand Down Expand Up @@ -43,7 +42,7 @@ const permissionOptions = [
label: "Roadmap and Announcements",
value: "roadmap",
},
]
];

export const settingsCollectionConfig = {
crowdin: true,
Expand All @@ -65,7 +64,7 @@ export const settingsCollectionConfig = {
label: "Title",
name: "title",
widget: "string",
crowdin: true
crowdin: true,
},
{
label: "Columns",
Expand All @@ -83,7 +82,7 @@ export const settingsCollectionConfig = {
name: "title",
required: false,
widget: "string",
crowdin: true
crowdin: true,
},
{
label: "Menu Items",
Expand Down Expand Up @@ -120,12 +119,12 @@ export const settingsCollectionConfig = {
{
name: "source",
widget: "string",
crowdin: false
crowdin: false,
},
{
name: "destination",
widget: "string",
crowdin: false
crowdin: false,
},
],
},
Expand All @@ -143,14 +142,14 @@ export const settingsCollectionConfig = {
widget: "list",
fields: [
{
name: 'category',
label: 'Category',
widget: 'relation',
collection: 'categories',
search_fields: ['name'],
value_field: 'id',
display_fields: ['name'],
options_length: 300
name: "category",
label: "Category",
widget: "relation",
collection: "categories",
search_fields: ["name"],
value_field: "id",
display_fields: ["name"],
options_length: 300,
},
],
},
Expand All @@ -171,7 +170,7 @@ export const settingsCollectionConfig = {
label: "Name",
name: "name",
widget: "string",
crowdin: true
crowdin: true,
},
{
label: "Type",
Expand Down Expand Up @@ -202,19 +201,19 @@ export const settingsCollectionConfig = {
label: "Twitter handle",
name: "twitter",
widget: "string",
crowdin: false
crowdin: false,
},
{
label: "Website url",
name: "website_url",
widget: "string",
crowdin: false
crowdin: false,
},
{
label: "Description",
name: "body",
widget: "string",
crowdin: true
crowdin: true,
},
],
},
Expand Down Expand Up @@ -255,7 +254,7 @@ export const settingsCollectionConfig = {
name: "title",
label: "Title",
widget: "string",
crowdin: true
crowdin: true,
},
{
name: "body",
Expand All @@ -268,7 +267,7 @@ export const settingsCollectionConfig = {
hint: "If page url is not specified (e.g. 'learn/glossary'), it will be used globally",
required: false,
widget: "string",
crowdin: false
crowdin: false,
},
],
},
Expand All @@ -294,7 +293,7 @@ export const settingsCollectionConfig = {
search_fields: ["title"],
value_field: "id",
display_fields: ["title"],
options_length: 300
options_length: 300,
},
],
},
Expand All @@ -315,36 +314,36 @@ export const settingsCollectionConfig = {
label: "Hero banner title",
widget: "string",
required: true,
crowdin: true
crowdin: true,
},
{
name: "hero_description",
label: "Hero description",
widget: "string",
required: true,
crowdin: true
crowdin: true,
},
{
name: "show_hero_cta",
label: "Show hero banner CTA",
widget: "boolean",
default: true,
crowdin: true
crowdin: true,
},
{
name: "hero_cta_copy",
label: "Hero banner CTA copy",
widget: "string",
required: false,
crowdin: true
crowdin: true,
},
{
name: "roadmap_post_ps",
label: "Roadmap post p.s. copy",
widget: "markdown",
required: false,
crowdin: true
}
crowdin: true,
},
],
},
{
Expand All @@ -369,14 +368,55 @@ export const settingsCollectionConfig = {
label: "Name",
widget: "string",
crowdin: false,
required: false
required: false,
},
{
name: "access",
label: "Access to collections",
multiple: true,
widget: "select",
options: permissionOptions
options: permissionOptions,
},
],
},
],
},
{
label: "Latest Announcements",
name: "LatestAnnouncements",
file: `_data/settings/latest-announcements.yml`,
crowdin: false,
fields: [
{
label: "announcements",
name: "announcements",
widget: "list",
fields: [
{
name: "image",
widget: "image",
crowdin: false,
},
{
name: "text",
widget: "string",
crowdin: false,
},
{
name: "buttonText",
widget: "string",
crowdin: false,
},
{
name: "buttonLink",
widget: "string",
crowdin: false,
},
{
name: "isActive",
widget: "boolean",
default: true,
crowdin: false,
},
],
},
Expand Down
26 changes: 26 additions & 0 deletions workspaces/cms-data/src/settings/latest-announcements.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { getJSON } from "@starknet-io/cms-utils/src/index";

export type LatestAnnouncements = {
readonly image: string;
readonly text: string;
readonly buttonText: string;
readonly buttonLink: string;
readonly isActive: boolean;
};

export async function getLatestAnnouncements(
context: EventContext<{}, any, Record<string, unknown>>
) {
try {
const latestAnnouncements = await getJSON(
"data/latest-announcements/latest-announcements",
context
);

return latestAnnouncements;
} catch (cause) {
throw new Error("getLatestAnnouncements failed!", {
cause,
});
}
}
Loading
Loading