@1hive/tecommons-ui 中文文档教程

发布于 3年前 浏览 22 更新于 3年前

Overview

这个库是用于构建用户界面的 aragonUI 库的一个分支。 该库的主题是为从现在开始在 TokenEngineer 项目中使用而定制的。 它提供构建感觉与 TEC 生态系统集成的体验所需的组件,并且可以在客户端或服务器端使用。

可以在 aragonUI 网站 上找到完整的文档。

Getting Started

如果您不熟悉 aragonUI,我们建议您从入门页面开始。 如果您只想知道如何将 aragonUI 添加到您的项目中,请查看快速设置:

Quick setup

将 tecUI 与 npm 中的样式组件一起

npm install --save @tecommons/ui styled-components

安装:将其资产复制到您的公共目录中:

npx copy-aragon-ui-assets ./public

使用 Main< 包装您的应用程序/code> 组件:

import React from 'react'
import { Main } from '@aragon/ui'

function App() {
  return (
    <Main>
      <h1>Hello aragonUI!</h1>
    </Main>
  )
}

您的项目现在可以使用 TEC-UI。 ????

打开 https://ui.aragon.org/ 查看可用组件的列表并了解如何使用它们。

Assets

TEC-UI 需要一些资产(例如字体)才能正常工作。 这些需要复制到库可以访问的地方,例如使用 public/ 目录/blob/master/packages/react-scripts/template/README.md#adding-assets-outside-of-the-module-system">创建 React 应用程序

使用提供的 copy-aragon-ui-assets 命令复制这些资产:

npx copy-aragon-ui-assets ./public

默认情况下,它将在指定目录中创建一个名为 aragon-ui 的目录。

该安置通过

组件与库通信。 默认路径是 ./aragon-ui/,但您可以使用 assetsUrl 属性更改它:

import { Main } from '@aragon/ui'

const App = () => (
  <Main assetsUrl="http://example.com/aragon-ui-assets/">
    <h1>Hello aragonUI!</h1>
  </Main>
)

您可能还想将它添加为项目中的构建步骤,这样tecUI就可以升级而不必担心这个了。

"scripts": {
  "sync-assets": "copy-aragon-ui-assets ./public",
  "build": "npm run sync-assets && react-scripts build",
  "start": "npm run sync-assets && react-scripts start"
}

有关详细信息,请参阅 copy-aragon-ui-assets -h

Build and Develop

请查看 CONTRIBUTING.md

License

麻省理工学院,请参阅 LICENSE

Overview

This library is a fork from aragonUI library used to build user interfaces. The theme of the library was customized for being used in the TokenEngineer projects from now on. It provides the components needed to build experiences that feel integrated with TEC ecosystem, and can be used both client or server side.

The complete documentation can be found on the aragonUI website.

Getting Started

If you are unfamiliar with aragonUI, we recommend you to start with the getting started page. If you only want to know how to add aragonUI to your project, have a look at the quick setup:

Quick setup

Install tecUI alongside styled-components from npm::

npm install --save @tecommons/ui styled-components

Copy its assets into your public directory:

npx copy-aragon-ui-assets ./public

Wrap your app with the Main component:

import React from 'react'
import { Main } from '@aragon/ui'

function App() {
  return (
    <Main>
      <h1>Hello aragonUI!</h1>
    </Main>
  )
}

Your project is now ready to use TEC-UI. ????

Open https://ui.aragon.org/ to see the list of the available components and learn how to use them.

Assets

TEC-UI require some assets (e.g. fonts) in order to work properly. These need to be copied where they can be accessed by the library, like the public/ directory of a project using Create React App.

Copy these assets using the provided copy-aragon-ui-assets command:

npx copy-aragon-ui-assets ./public

By default, it will create a directory named aragon-ui in the specified directory.

This emplacement is communicated to the library through the <Main> component. The default path is ./aragon-ui/, but you can change it using the assetsUrl prop:

import { Main } from '@aragon/ui'

const App = () => (
  <Main assetsUrl="http://example.com/aragon-ui-assets/">
    <h1>Hello aragonUI!</h1>
  </Main>
)

You may also want to add it as a build step in your project, so that tecUI can be upgraded without having to worry about this.

"scripts": {
  "sync-assets": "copy-aragon-ui-assets ./public",
  "build": "npm run sync-assets && react-scripts build",
  "start": "npm run sync-assets && react-scripts start"
}

See copy-aragon-ui-assets -h for more information.

Build and Develop

Please have a look at CONTRIBUTING.md.

License

MIT, see LICENSE.

更多

友情链接

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文