diff --git a/backend/src/Web/Features/Contents/Data/ContentDbContext.cs b/backend/src/Web/Features/Contents/Data/ContentDbContext.cs index 767dffd..26e74a2 100644 --- a/backend/src/Web/Features/Contents/Data/ContentDbContext.cs +++ b/backend/src/Web/Features/Contents/Data/ContentDbContext.cs @@ -51,11 +51,6 @@ public class ContentDbContext( .OwnsOne(x => x.Socials) .ToTable(nameof(Socials)); - modelBuilder - .Entity() - .OwnsOne(x => x.Colors) - .ToTable(nameof(Colors)); - modelBuilder .Entity() .OwnsOne(x => x.Images) diff --git a/backend/src/Web/Features/Contents/Data/Creator.cs b/backend/src/Web/Features/Contents/Data/Creator.cs index f0d6713..762349d 100644 --- a/backend/src/Web/Features/Contents/Data/Creator.cs +++ b/backend/src/Web/Features/Contents/Data/Creator.cs @@ -12,25 +12,10 @@ public class Creator public Slugs Slugs { get; set; } = null!; [MaxLength(255)] public string? Title { get; set; } public Socials Socials { get; set; } = new(); - public Colors Colors { get; set; } = new(); public Images Images { get; set; } = new(); public PresentationInfos PresentationInfos { get; set; } = new(); } -public class Colors -{ - [MaxLength(9)] public string Primary { get; set; } = null!; - [MaxLength(9)] public string Secondary { get; set; } = null!; - [MaxLength(9)] public string Background { get; set; } = null!; - [MaxLength(9)] public string Surface { get; set; } = null!; - [MaxLength(9)] public string Error { get; set; } = null!; - [MaxLength(9)] public string OnPrimary { get; set; } = null!; - [MaxLength(9)] public string OnSecondary { get; set; } = null!; - [MaxLength(9)] public string OnBackground { get; set; } = null!; - [MaxLength(9)] public string OnSurface { get; set; } = null!; - [MaxLength(9)] public string OnError { get; set; } = null!; -} - public class Socials { [MaxLength(255)] public string? FacebookUrl { get; set; } diff --git a/backend/src/Web/Features/Contents/Data/Migrations/20250208043324_RemoveColors.Designer.cs b/backend/src/Web/Features/Contents/Data/Migrations/20250208043324_RemoveColors.Designer.cs new file mode 100644 index 0000000..05560fe --- /dev/null +++ b/backend/src/Web/Features/Contents/Data/Migrations/20250208043324_RemoveColors.Designer.cs @@ -0,0 +1,376 @@ +// +using System; +using Hutopy.Web.Features.Contents.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Hutopy.Web.Features.Contents.Data.Migrations +{ + [DbContext(typeof(ContentDbContext))] + [Migration("20250208043324_RemoveColors")] + partial class RemoveColors + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasDefaultSchema("Content") + .HasAnnotation("ProductVersion", "8.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Content", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("CURRENT_TIMESTAMP"); + + b.Property("CreatedBy") + .HasColumnType("uuid"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedBy") + .HasColumnType("uuid"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.Property("HtmlFileUrl") + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.Property("ThumbnailUrl") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Urls") + .HasColumnType("text[]"); + + b.HasKey("Id"); + + b.HasIndex("CreatedBy"); + + b.ToTable("Contents", "Content"); + }); + + modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Creator", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AcceptDonation") + .HasColumnType("boolean"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedBy") + .HasColumnType("uuid"); + + b.Property("SlugsId") + .HasColumnType("uuid"); + + b.Property("Title") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("Verified") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("SlugsId"); + + b.ToTable("Creators", "Content"); + }); + + modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Slugs", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Active") + .HasColumnType("boolean"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedBy") + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("NormalizedName") + .IsRequired() + .ValueGeneratedOnAddOrUpdate() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasComputedColumnSql("LOWER( \"Content\".\"Slugs\".\"Name\")", true); + + b.Property("ReservedUntil") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique(); + + b.ToTable("Slugs", "Content"); + }); + + modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Content", b => + { + b.HasOne("Hutopy.Web.Features.Contents.Data.Creator", "Creator") + .WithMany() + .HasForeignKey("CreatedBy") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsMany("Hutopy.Web.Features.Contents.Data.ContentReaction", "Reactions", b1 => + { + b1.Property("ContentId") + .HasColumnType("uuid"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property("Id")); + + b1.Property("Reaction") + .HasColumnType("integer"); + + b1.Property("UserId") + .HasColumnType("uuid"); + + b1.Property("UserName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b1.HasKey("ContentId", "Id"); + + b1.ToTable("Reactions", "Content"); + + b1.WithOwner() + .HasForeignKey("ContentId"); + }); + + b.Navigation("Creator"); + + b.Navigation("Reactions"); + }); + + modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Creator", b => + { + b.HasOne("Hutopy.Web.Features.Contents.Data.Slugs", "Slugs") + .WithMany() + .HasForeignKey("SlugsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsOne("Hutopy.Web.Features.Contents.Data.Images", "Images", b1 => + { + b1.Property("CreatorId") + .HasColumnType("uuid"); + + b1.Property("Banner") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b1.Property("Logo") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b1.HasKey("CreatorId"); + + b1.ToTable("Images", "Content"); + + b1.WithOwner() + .HasForeignKey("CreatorId"); + }); + + b.OwnsOne("Hutopy.Web.Features.Contents.Data.PresentationInfos", "PresentationInfos", b1 => + { + b1.Property("CreatorId") + .HasColumnType("uuid"); + + b1.Property("Email") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b1.Property("Image1Url") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)"); + + b1.Property("Image2Url") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)"); + + b1.Property("Image3Url") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)"); + + b1.Property("Image4Url") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)"); + + b1.Property("ImagesSubtitle") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)"); + + b1.Property("ImagesText") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("character varying(10000)"); + + b1.Property("MainImageText") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("character varying(10000)"); + + b1.Property("MainImageUrl") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)"); + + b1.Property("MainVideoText") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("character varying(10000)"); + + b1.Property("PhoneNumber") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b1.Property("Title") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)"); + + b1.Property("VideoSubtitle") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)"); + + b1.Property("VideoSubtitleMain") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)"); + + b1.Property("VideoText") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("character varying(10000)"); + + b1.Property("VideoUrl") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)"); + + b1.Property("VideoUrlMain") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("character varying(2000)"); + + b1.HasKey("CreatorId"); + + b1.ToTable("PresentationInfos", "Content"); + + b1.WithOwner() + .HasForeignKey("CreatorId"); + }); + + b.OwnsOne("Hutopy.Web.Features.Contents.Data.Socials", "Socials", b1 => + { + b1.Property("CreatorId") + .HasColumnType("uuid"); + + b1.Property("FacebookUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b1.Property("InstagramUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b1.Property("LinkedInUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b1.Property("RedditUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b1.Property("TikTokUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b1.Property("WebsiteUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b1.Property("XUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b1.Property("YoutubeUrl") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b1.HasKey("CreatorId"); + + b1.ToTable("Socials", "Content"); + + b1.WithOwner() + .HasForeignKey("CreatorId"); + }); + + b.Navigation("Images") + .IsRequired(); + + b.Navigation("PresentationInfos") + .IsRequired(); + + b.Navigation("Slugs"); + + b.Navigation("Socials") + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/backend/src/Web/Features/Contents/Data/Migrations/20250208043324_RemoveColors.cs b/backend/src/Web/Features/Contents/Data/Migrations/20250208043324_RemoveColors.cs new file mode 100644 index 0000000..da05c8c --- /dev/null +++ b/backend/src/Web/Features/Contents/Data/Migrations/20250208043324_RemoveColors.cs @@ -0,0 +1,52 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Hutopy.Web.Features.Contents.Data.Migrations +{ + /// + public partial class RemoveColors : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Colors", + schema: "Content"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Colors", + schema: "Content", + columns: table => new + { + CreatorId = table.Column(type: "uuid", nullable: false), + Background = table.Column(type: "character varying(9)", maxLength: 9, nullable: false), + Error = table.Column(type: "character varying(9)", maxLength: 9, nullable: false), + OnBackground = table.Column(type: "character varying(9)", maxLength: 9, nullable: false), + OnError = table.Column(type: "character varying(9)", maxLength: 9, nullable: false), + OnPrimary = table.Column(type: "character varying(9)", maxLength: 9, nullable: false), + OnSecondary = table.Column(type: "character varying(9)", maxLength: 9, nullable: false), + OnSurface = table.Column(type: "character varying(9)", maxLength: 9, nullable: false), + Primary = table.Column(type: "character varying(9)", maxLength: 9, nullable: false), + Secondary = table.Column(type: "character varying(9)", maxLength: 9, nullable: false), + Surface = table.Column(type: "character varying(9)", maxLength: 9, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Colors", x => x.CreatorId); + table.ForeignKey( + name: "FK_Colors_Creators_CreatorId", + column: x => x.CreatorId, + principalSchema: "Content", + principalTable: "Creators", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + } + } +} diff --git a/backend/src/Web/Features/Contents/Data/Migrations/ContentDbContextModelSnapshot.cs b/backend/src/Web/Features/Contents/Data/Migrations/ContentDbContextModelSnapshot.cs index c20bd59..8300c68 100644 --- a/backend/src/Web/Features/Contents/Data/Migrations/ContentDbContextModelSnapshot.cs +++ b/backend/src/Web/Features/Contents/Data/Migrations/ContentDbContextModelSnapshot.cs @@ -192,69 +192,6 @@ namespace Hutopy.Web.Features.Contents.Data.Migrations .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.OwnsOne("Hutopy.Web.Features.Contents.Data.Colors", "Colors", b1 => - { - b1.Property("CreatorId") - .HasColumnType("uuid"); - - b1.Property("Background") - .IsRequired() - .HasMaxLength(9) - .HasColumnType("character varying(9)"); - - b1.Property("Error") - .IsRequired() - .HasMaxLength(9) - .HasColumnType("character varying(9)"); - - b1.Property("OnBackground") - .IsRequired() - .HasMaxLength(9) - .HasColumnType("character varying(9)"); - - b1.Property("OnError") - .IsRequired() - .HasMaxLength(9) - .HasColumnType("character varying(9)"); - - b1.Property("OnPrimary") - .IsRequired() - .HasMaxLength(9) - .HasColumnType("character varying(9)"); - - b1.Property("OnSecondary") - .IsRequired() - .HasMaxLength(9) - .HasColumnType("character varying(9)"); - - b1.Property("OnSurface") - .IsRequired() - .HasMaxLength(9) - .HasColumnType("character varying(9)"); - - b1.Property("Primary") - .IsRequired() - .HasMaxLength(9) - .HasColumnType("character varying(9)"); - - b1.Property("Secondary") - .IsRequired() - .HasMaxLength(9) - .HasColumnType("character varying(9)"); - - b1.Property("Surface") - .IsRequired() - .HasMaxLength(9) - .HasColumnType("character varying(9)"); - - b1.HasKey("CreatorId"); - - b1.ToTable("Colors", "Content"); - - b1.WithOwner() - .HasForeignKey("CreatorId"); - }); - b.OwnsOne("Hutopy.Web.Features.Contents.Data.Images", "Images", b1 => { b1.Property("CreatorId") @@ -419,9 +356,6 @@ namespace Hutopy.Web.Features.Contents.Data.Migrations .HasForeignKey("CreatorId"); }); - b.Navigation("Colors") - .IsRequired(); - b.Navigation("Images") .IsRequired(); diff --git a/backend/src/Web/Features/Contents/Handlers/ChangeColors.cs b/backend/src/Web/Features/Contents/Handlers/ChangeColors.cs deleted file mode 100644 index 0aa63d3..0000000 --- a/backend/src/Web/Features/Contents/Handlers/ChangeColors.cs +++ /dev/null @@ -1,113 +0,0 @@ -using Hutopy.Web.Features.Contents.Data; - -namespace Hutopy.Web.Features.Contents.Handlers; - -[PublicAPI] -public record ChangeColorsRequest( - Guid CreatorId, - string Primary, - string Secondary, - string Background, - string Surface, - string Error, - string OnPrimary, - string OnSecondary, - string OnBackground, - string OnSurface, - string OnError); - -[PublicAPI] -public sealed class ChangeColorsRequestValidator - : Validator -{ - public ChangeColorsRequestValidator() - { - RuleFor(x => x.Primary) - .MinimumLength(4).WithMessage("The minimum value should be in the format #444") - .MaximumLength(9).WithMessage("The maximum value should be in the format #11223344") - .Must(x => x.StartsWith('#')).WithMessage("The format should be a valid html color and start with #"); - - RuleFor(x => x.Secondary) - .MinimumLength(4).WithMessage("The minimum value should be in the format #444") - .MaximumLength(9).WithMessage("The maximum value should be in the format #11223344") - .Must(x => x.StartsWith('#')).WithMessage("The format should be a valid html color and start with #"); - - RuleFor(x => x.Background) - .MinimumLength(4).WithMessage("The minimum value should be in the format #444") - .MaximumLength(9).WithMessage("The maximum value should be in the format #11223344") - .Must(x => x.StartsWith('#')).WithMessage("The format should be a valid html color and start with #"); - - RuleFor(x => x.Surface) - .MinimumLength(4).WithMessage("The minimum value should be in the format #444") - .MaximumLength(9).WithMessage("The maximum value should be in the format #11223344") - .Must(x => x.StartsWith('#')).WithMessage("The format should be a valid html color and start with #"); - - RuleFor(x => x.Error) - .MinimumLength(4).WithMessage("The minimum value should be in the format #444") - .MaximumLength(9).WithMessage("The maximum value should be in the format #11223344") - .Must(x => x.StartsWith('#')).WithMessage("The format should be a valid html color and start with #"); - - RuleFor(x => x.OnPrimary) - .MinimumLength(4).WithMessage("The minimum value should be in the format #444") - .MaximumLength(9).WithMessage("The maximum value should be in the format #11223344") - .Must(x => x.StartsWith('#')).WithMessage("The format should be a valid html color and start with #"); - - RuleFor(x => x.OnSecondary) - .MinimumLength(4).WithMessage("The minimum value should be in the format #444") - .MaximumLength(9).WithMessage("The maximum value should be in the format #11223344") - .Must(x => x.StartsWith('#')).WithMessage("The format should be a valid html color and start with #"); - - RuleFor(x => x.OnBackground) - .MinimumLength(4).WithMessage("The minimum value should be in the format #444") - .MaximumLength(9).WithMessage("The maximum value should be in the format #11223344") - .Must(x => x.StartsWith('#')).WithMessage("The format should be a valid html color and start with #"); - - RuleFor(x => x.OnSurface) - .MinimumLength(4).WithMessage("The minimum value should be in the format #444") - .MaximumLength(9).WithMessage("The maximum value should be in the format #11223344") - .Must(x => x.StartsWith('#')).WithMessage("The format should be a valid html color and start with #"); - - RuleFor(x => x.OnError) - .MinimumLength(4).WithMessage("The minimum value should be in the format #444") - .MaximumLength(9).WithMessage("The maximum value should be in the format #11223344") - .Must(x => x.StartsWith('#')).WithMessage("The format should be a valid html color and start with #"); - } -} - -public class ChangeColorsHandler( - ContentDbContext context) - : Endpoint -{ - public override void Configure() - { - Post("/api/creators/{CreatorId}/colors"); - Options(o => o.WithTags("Creators")); - } - - public override async Task HandleAsync( - ChangeColorsRequest request, - CancellationToken ct) - { - var creator = await context - .Creators - .Include(c => c.Colors) - .SingleAsync( - c => c.Id == request.CreatorId, - cancellationToken: ct); - - creator.Colors.Primary = request.Primary; - creator.Colors.Secondary = request.Secondary; - creator.Colors.Background = request.Background; - creator.Colors.Surface = request.Surface; - creator.Colors.Error = request.Error; - creator.Colors.OnPrimary = request.OnPrimary; - creator.Colors.OnSecondary = request.OnSecondary; - creator.Colors.OnBackground = request.OnBackground; - creator.Colors.OnSurface = request.OnSurface; - creator.Colors.OnError = request.OnError; - - await context.SaveChangesAsync(ct); - - await SendOkAsync(ct); - } -} diff --git a/backend/src/Web/Features/Contents/Handlers/CreateCreator.cs b/backend/src/Web/Features/Contents/Handlers/CreateCreator.cs index e760844..27f5c77 100644 --- a/backend/src/Web/Features/Contents/Handlers/CreateCreator.cs +++ b/backend/src/Web/Features/Contents/Handlers/CreateCreator.cs @@ -63,20 +63,7 @@ public sealed class CreateCreatorHandler( { Id = req.CreatorId, CreatedBy = User.GetUserId(), - Slugs = slug, - Colors = - { - Primary = "#A30E79", - Secondary = "#6B0065", - Background = "#ffffff", - Surface = "#50f050", - Error = "#B00020", - OnPrimary = "#ffffff", - OnSecondary = "#000000", - OnBackground = "#000000", - OnSurface = "#000000", - OnError = "#ffffff", - } + Slugs = slug }, ct); diff --git a/backend/src/Web/Features/Contents/Handlers/GetCreatorByAlias.cs b/backend/src/Web/Features/Contents/Handlers/GetCreatorByAlias.cs index 41c8732..88107ba 100644 --- a/backend/src/Web/Features/Contents/Handlers/GetCreatorByAlias.cs +++ b/backend/src/Web/Features/Contents/Handlers/GetCreatorByAlias.cs @@ -18,7 +18,6 @@ public class GetCreatorByAliasResponse( string name, string? title, Socials socials, - Colors colors, PresentationInfos presentationInfos, Images images) { @@ -30,7 +29,6 @@ public class GetCreatorByAliasResponse( public string Name { get; } = name; public string? Title { get; } = title; public Socials Socials { get; } = socials; - public Colors Colors { get; } = colors; public PresentationInfos PresentationInfos { get; } = presentationInfos; public Images Images { get; } = images; } @@ -79,7 +77,6 @@ public class GetCreatorByAliasHandler( c.Slugs.NormalizedName, c.Title, c.Socials, - c.Colors, c.PresentationInfos, c.Images)) .SingleOrDefaultAsync(ct); diff --git a/backend/src/Web/Features/Contents/Handlers/GetCreatorProfile.cs b/backend/src/Web/Features/Contents/Handlers/GetCreatorProfile.cs index 177ebf9..dbb2205 100644 --- a/backend/src/Web/Features/Contents/Handlers/GetCreatorProfile.cs +++ b/backend/src/Web/Features/Contents/Handlers/GetCreatorProfile.cs @@ -1,5 +1,4 @@ -using Hutopy.Web.Common; -using Hutopy.Web.Common.Security; +using Hutopy.Web.Common.Security; using Hutopy.Web.Features.Contents.Data; namespace Hutopy.Web.Features.Contents.Handlers; @@ -14,7 +13,6 @@ public sealed class GetCreatorProfileResponse public string Name { get; set; } public bool Verified { get; set; } public bool AcceptDonation { get; set; } - public Colors Colors { get; set; } public Images Images { get; set; } public PresentationInfos PresentationInfos { get; set; } public Socials Socials { get; set; } @@ -48,7 +46,6 @@ public class GetCreatorProfileHandler( Name = c.Slugs.NormalizedName, Verified = c.Verified, AcceptDonation = c.AcceptDonation, - Colors = c.Colors, Images = c.Images, PresentationInfos = c.PresentationInfos, Socials = c.Socials, diff --git a/frontend/src/App.vue b/frontend/src/App.vue index df77d98..05c4058 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -2,15 +2,14 @@
-
+
+ class="min-h-screen justify-center items-center bg-hBackground">
@@ -18,8 +17,7 @@
+ class="min-h-screen justify-center items-center bg-hBackground">
diff --git a/frontend/src/assets/main.css b/frontend/src/assets/main.css index bd6213e..cd284cb 100644 --- a/frontend/src/assets/main.css +++ b/frontend/src/assets/main.css @@ -1,3 +1,18 @@ @tailwind base; @tailwind components; -@tailwind utilities; \ No newline at end of file +@tailwind utilities; + +:root { + --h-background: #2D2728; + --h-on-background: #f1f1f1; + --h-surface: #494949; + --h-on-surface: #eca815; + --h-primary: #231F20; + --h-on-primary: #d9e1e1; + --h-secondary: #683B1E; + --h-on-secondary: #ececec; + --h-tertiary: #272A44; + --h-on-tertiary: #bdb6b6; + --h-error: #bc2f2f; + --h-on-error: #ffffff; +} \ No newline at end of file diff --git a/frontend/src/stores/brandingStore.js b/frontend/src/stores/brandingStore.js index c4e2344..7f51705 100644 --- a/frontend/src/stores/brandingStore.js +++ b/frontend/src/stores/brandingStore.js @@ -16,19 +16,6 @@ export const useBrandingStore = defineStore( {}, {writeDefaults: false}) - const defaultColors = { - "background": "#f4f4f4", - "error": "#f4f4f4", - "primary": "#f4f4f4", - "secondary": "#f4f4f4", - "surface": "#f4f4f4", - "onBackground": "#000", - "onError": "#000", - "onPrimary": "#000", - "onSecondary": "#000", - "onSurface": "#000", - } - const colors = ref(defaultColors) const presentationInfos = ref([]) const route = useRoute() @@ -41,12 +28,10 @@ export const useBrandingStore = defineStore( if (newCreator !== undefined) { value.value = await fetchCreatorData(newCreator) currentBrand.value = newCreator - colors.value = value.value?.colors presentationInfos.value = value.value?.presentationInfos } else { value.value = {} currentBrand.value = undefined - colors.value = defaultColors presentationInfos.value = [] } } @@ -68,7 +53,6 @@ export const useBrandingStore = defineStore( return { currentBrand, value, - colors, loading, presentationInfos } diff --git a/frontend/src/views/contents/ContentEditorPage.vue b/frontend/src/views/contents/ContentEditorPage.vue index 42d3829..daa94dc 100644 --- a/frontend/src/views/contents/ContentEditorPage.vue +++ b/frontend/src/views/contents/ContentEditorPage.vue @@ -55,14 +55,14 @@ onMounted(() => { -
+
-
+
Éditeur de contenu
-