Skip to content

Commit

Permalink
Feature: Input Details component (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
brunomenezes authored Sep 28, 2023
1 parent 3bee8bd commit eb96608
Show file tree
Hide file tree
Showing 37 changed files with 1,881 additions and 47 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI
on: [push]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: latest
cache: 'yarn'

- name: Install Dependencies
run: yarn install --frozen-lockfile

- name: Code format check
run: yarn format:check

- name: Linting
run: yarn lint

- name: Run Tests
run: yarn test:ci
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
dist
node_modules
storybook-static
coverage
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.next
dist
node_modules
.storybook
graphql
contracts.ts
**/rollups-wagmi/src/index.tsx
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"tabWidth": 4,
"tabWidth": 4,
"overrides": [
{
"files": "*.md",
Expand Down
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
}
}
12 changes: 6 additions & 6 deletions apps/web/src/app/applications/[address]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
"use client";
import { FC, useEffect, useState } from "react";
import { useScrollIntoView } from "@mantine/hooks";
import { pathOr } from "ramda";
import { TbInbox } from "react-icons/tb";
import {
Anchor,
Breadcrumbs,
Expand All @@ -14,14 +10,18 @@ import {
Text,
Title,
} from "@mantine/core";
import { useScrollIntoView } from "@mantine/hooks";
import Link from "next/link";
import { InputOrderByInput, useInputsQuery } from "../../../graphql";
import { pathOr } from "ramda";
import { FC, useEffect, useState } from "react";
import { TbInbox } from "react-icons/tb";
import Address from "../../../components/address";
import InputRow from "../../../components/inputRow";
import { InputOrderByInput, useInputsQuery } from "../../../graphql";
import {
limitBounds,
usePaginationParams,
} from "../../../hooks/usePaginationParams";
import InputRow from "../../../components/inputRow";

export type ApplicationPageProps = {
params: { address: string };
Expand Down
3 changes: 1 addition & 2 deletions apps/web/src/components/inputRow.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"use client";
import { erc20PortalAddress, etherPortalAddress } from "@cartesi/rollups-wagmi";
import {
ActionIcon,
Badge,
Collapse,
Group,
JsonInput,
Stack,
Table,
Tabs,
Text,
Expand All @@ -22,7 +22,6 @@ import {
TbX,
} from "react-icons/tb";
import { Hex, formatUnits, getAddress, hexToString } from "viem";
import { erc20PortalAddress, etherPortalAddress } from "@cartesi/rollups-wagmi";
import { InputItemFragment } from "../graphql";
import Address from "./address";

Expand Down
3 changes: 3 additions & 0 deletions apps/workshop/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
module.exports = {
root: true,
extends: ["cartesi"],
rules: {
"@next/next/no-img-element": 'off'
}
};
1 change: 1 addition & 0 deletions apps/workshop/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const config: StorybookConfig = {
"@storybook/addon-interactions",
"@storybook/addon-styling",
"storybook-dark-mode",
"@storybook/addon-viewport",
],
docs: {
autodocs: "tag",
Expand Down
12 changes: 6 additions & 6 deletions apps/workshop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ This template provides a minimal setup to get React working in Vite with HMR and

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:
- Configure the top-level `parserOptions` property like this:

```js
parserOptions: {
Expand All @@ -22,6 +22,6 @@ If you are developing a production application, we recommend updating the config
},
```

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
1 change: 1 addition & 0 deletions apps/workshop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@storybook/addon-links": "^7.4.0",
"@storybook/addon-onboarding": "^1.0.8",
"@storybook/addon-styling": "^1.3.7",
"@storybook/addon-viewport": "^7.4.0",
"@storybook/blocks": "^7.4.0",
"@storybook/cli": "^7.4.0",
"@storybook/preview-api": "^7.4.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/workshop/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState } from "react";
import "./App.css";
import reactLogo from "./assets/react.svg";
import viteLogo from "/vite.svg";
import "./App.css";

function App() {
const [count, setCount] = useState(0);
Expand Down
Loading

2 comments on commit eb96608

@vercel
Copy link

@vercel vercel bot commented on eb96608 Sep 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on eb96608 Sep 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

rollups-explorer-workshop – ./apps/workshop

rollups-explorer-workshop-git-main-cartesi.vercel.app
rollups-explorer-workshop.vercel.app
rollups-explorer-workshop-cartesi.vercel.app

Please sign in to comment.