Documentation
Feedback
Guides
Learning Center

Learning Center
Learning Center
Homogeneidade visual
View in English
This content was migrated from the VTEX Learning Center and is no longer being actively maintained. For the most accurate and up-to-date information, please check the official documentation.

Introdução

O Admin Framework existe para unificar canais e facilitar a vida do operador de loja. É importante, no entanto, que a experiência visual seja homogênea para evitar inconsistência de usabilidade.

A fim de facilitar a integração visual para o desenvolvedor, o Styleguide, encontra-se disponível e com vários componentes que podem ser utilizados para criar rapidamente telas administrativas.

Atividade

  1. No passo 1, adicionamos o vtex.styleguide como dependência, importe o Layout e PageBlock do styleguide para que possamos usá-los:

_10
import { Layout, PageBlock } from 'vtex.styleguide'

  1. Ambos estes componentes são responsáveis por criar o layout de admin que é utilizado pelas apps VTEX, você pode compô-los da seguinte forma:

_14
import React, { FC } from 'react'
_14
import { Layout, PageBlock } from 'vtex.styleguide'
_14
_14
const AdminExample: FC = () => {
_14
return (
_14
<Layout>
_14
<PageBlock variation="full">
_14
<h1>Hello, World!</h1>
_14
</PageBlock>
_14
</Layout>
_14
)
_14
}
_14
_14
export default AdminExample

  1. Vendo a documentação do PageBlock, nós podemos enriquecê-lo para adicionar um título e uma descrição:

_18
import React, { FC } from "react";
_18
import { Layout, PageBlock } from "vtex.styleguide";
_18
_18
const AdminExample: FC = () => {
_18
return (
_18
<Layout>
_18
<PageBlock
_18
+ title="Titulo"
_18
+ subtitle="Alguma explicação."
_18
+ variation="full"
_18
>
_18
<h1>Hello, World!</h1>
_18
</PageBlock>
_18
</Layout>
_18
);
_18
};
_18
_18
export default AdminExample;

O resultado esperado deve ser:

{"base64":"  ","img":{"width":1019,"height":280,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":14394,"url":"https://user-images.githubusercontent.com/18701182/92802313-cc7df800-f38c-11ea-95a1-035948dbbc85.png"}}

Answer sheet

See answer sheet for adminExample.tsx
adminExample.tsx

_14
import React, { FC } from 'react'
_14
import { Layout, PageBlock } from 'vtex.styleguide'
_14
_14
const AdminExample: FC = () => {
_14
return (
_14
<Layout>
_14
<PageBlock title="Titulo" subtitle="Alguma explicação." variation="full">
_14
<h1>Hello, World!</h1>
_14
</PageBlock>
_14
</Layout>
_14
)
_14
}
_14
_14
export default AdminExample

On this page