Skip to content

Commit

Permalink
change the type selector color in dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
invisal committed Dec 15, 2024
1 parent 4174a30 commit 4cff920
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/app/(public)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ function CommunitySection() {
</svg>
<div className="font-bold mt-1">Github</div>
</DatabaseBlock>
<DatabaseBlock link="https://discord.gg/t8twVN5KdG">
<DatabaseBlock link="https://discord.gg/7zfESKF6QpG">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 127.14 96.36"
Expand Down
4 changes: 2 additions & 2 deletions src/components/gui/schema-editor/column-type-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ function ColumnTypeList({
}) {
return items.map((group) => (
<div key={group.name}>
<div className="text-sm font-bold py-1 px-4 bg-muted mb-1">
<div className="text-sm font-bold py-1 px-4 bg-accent mb-1">
{group.name}
</div>
<div className="flex flex-col">
{group.suggestions.map((type) => {
const itemClassName =
"py-0.5 px-3 pl-8 cursor-pointer hover:bg-gray-100";
"py-0.5 px-3 pl-8 cursor-pointer hover:bg-muted";

const parameters = type.parameters ?? [];
let content = <span>{type.name.toUpperCase()}</span>;
Expand Down
6 changes: 3 additions & 3 deletions src/components/gui/schema-editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ export default function SchemaEditor({
value.columns.length === 0
? {
name: "id",
type: "INTEGER",
type: databaseDriver.columnTypeSelector.idTypeName ?? "INTEGER",
constraint: {
primaryKey: true,
},
}
: {
name: "column",
type: "TEXT",
type: databaseDriver.columnTypeSelector.textTypeName ?? "TEXT",
constraint: {},
};

Expand All @@ -57,7 +57,7 @@ export default function SchemaEditor({
},
],
});
}, [value, onChange]);
}, [value, onChange, databaseDriver]);

const hasChange = checkSchemaChange(value);

Expand Down
8 changes: 4 additions & 4 deletions src/components/gui/tabs/relational-diagram-tab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ function mapSchema(
height: 14,
},
id: `${item.name}-${column.constraint.foreignKey.foreignTableName}`,
target: item.name,
source: column.constraint.foreignKey.foreignTableName || "",
targetHandle: column.name,
sourceHandle: column.constraint.foreignKey.foreignColumns
source: item.name,
target: column.constraint.foreignKey.foreignTableName || "",
sourceHandle: column.name,
targetHandle: column.constraint.foreignKey.foreignColumns
? column.constraint.foreignKey.foreignColumns[0]
: "",
animated: true,
Expand Down
2 changes: 1 addition & 1 deletion src/components/website-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function Footer() {
</li>
<li>
<Link
href="https://discord.gg/t8twVN5KdG"
href="https://discord.gg/7zfESKF6Qp"
className="hover:underline"
>
Community
Expand Down
4 changes: 4 additions & 0 deletions src/drivers/base-driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ export interface ColumnTypeSelector {
type: "dropdown" | "text";
dropdownOptions?: { value: string; text: string }[];
typeSuggestions?: ColumnTypeSuggestionGroup[];

// This will use for auto field when create table column
idTypeName?: string;
textTypeName?: string;
}

export interface DriverFlags {
Expand Down
2 changes: 2 additions & 0 deletions src/drivers/mysql/mysql-data-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { ColumnTypeSelector } from "../base-driver";

export const MYSQL_DATA_TYPE_SUGGESTION: ColumnTypeSelector = {
type: "text",
idTypeName: "INT",
textTypeName: "VARCHAR(255)",
typeSuggestions: [
{
name: "Integer",
Expand Down

0 comments on commit 4cff920

Please sign in to comment.