Skip to content

Commit

Permalink
⚡ 459 - UI remove tailwind classes (#1032)
Browse files Browse the repository at this point in the history
* Remove param className and add one new tableStyle
  • Loading branch information
johnxu16 authored Jul 18, 2023
1 parent 5c05ead commit 2494168
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .tina/__generated__/_graphql.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .tina/__generated__/_schema.json

Large diffs are not rendered by default.

16 changes: 6 additions & 10 deletions components/blocks/tableLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import React, { useEffect, useState } from "react";
import type { Template } from "tinacms";
import markdownItMultimdTable from "markdown-it-multimd-table";
import MarkdownIt from "markdown-it";
import classNames from "classnames";
import MarkdownIt from "markdown-it";
import markdownItMultimdTable from "markdown-it-multimd-table";
import { useEffect, useState } from "react";
import type { Template } from "tinacms";

const tableStyles = {
none: "",
basicBorder:
"descendant-table:border-1 descendant-table:border-solid descendant-table:p-2 descendant-th:border-1 descendant-th:border-solid descendant-th:p-2 descendant-td:border-1 descendant-td:border-solid descendant-td:p-2",
styled:
"descendant-th:border-b-sswRed [&>table>tbody>*:nth-child(even)]:bg-gray-75 descendant-th:bg-gray-75 descendant-th:border-b-sswRed descendant-table:w-full",
benefits:
"descendant-table:border-1 descendant-table:border-solid descendant-table:p-2 descendant-th:border-1 descendant-th:border-solid descendant-th:p-2 descendant-td:border-1 descendant-td:border-solid descendant-td:p-2 mt-5 flex justify-center descendant-tr:align-top descendant-ul:list-disc descendant-li:ml-6",
};

export const TableLayout = ({ data }) => {
Expand All @@ -27,7 +29,6 @@ export const TableLayout = ({ data }) => {
<div
className={classNames(
"not-prose child-table:border-1 descendant-th:border-1 descendant-th:border-gray-75 descendant-th:py-2 descendant-th:pl-2 descendant-td:border-y-1 descendant-td:py-1.5 descendant-td:pl-2",
data.className,
tableStyles[data.tableStyle]
)}
dangerouslySetInnerHTML={{ __html: mdxTableString }}
Expand Down Expand Up @@ -55,11 +56,6 @@ export const tableBlockSchema: Template = {
};
}),
},
{
type: "string",
label: "CSS Class Name",
name: "className",
},
{
type: "string",
label: "Table",
Expand Down
3 changes: 1 addition & 2 deletions content/consulting/software-audit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ benefits:
## How long does this normally take?

<TableLayout
tableStyle="basicBorder"
className="mt-5 flex justify-center descendant-tr:align-top descendant-ul:list-disc descendant-li:ml-6"
tableStyle="benefits"
mdxTable="
| Client time commitment | SSW time commitment |
|:-----------------------|:----------------------|
Expand Down

0 comments on commit 2494168

Please sign in to comment.