Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This configuration file was automatically generated by Gitpod.
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
# and commit this file to your remote git repository to share the goodness with others.

# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart

tasks:
- init: npm install && npm run build
command: npm run dev


4 changes: 4 additions & 0 deletions src/components/avatar/avatar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
img {
width: 50px;
height: 20px;
}
15 changes: 15 additions & 0 deletions src/components/avatar/avatar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import "./avatar.css"


/**
* @typedef {Object} AvatarProps
* @property {string} AvatarProps.imgSrc - some description here
* @property {string} AvatarProps.descricao - some description here
*
* @param {AvatarProps} props
*/
export function avatar({imgSrc, descricao}) {
return ` href
<img src="${imgSrc}" class="avatar" alt="${descricao}" />
`
}
29 changes: 29 additions & 0 deletions src/components/avatar/avatar.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type { StoryObj, Meta } from '@storybook/html';
import {avatar} from './avatar';
import type {AvatarProps} from './avatar';


// More on how to set up stories at: https://storybook.js.org/docs/html/writing-stories/introduction#default-export
const meta = {
title: 'App/Avatar',
tags: ['autodocs'],
render: (args) => {
return avatar(args);
},
argTypes: {
imgSrc: {description: 'endereço para a imgaem do logo'},
descricao: {description: 'descrição da imagem do logo'}
}
} satisfies Meta<AvatarProps>;

export default meta;
type Story = StoryObj;

// More on writing stories with args: https://storybook.js.org/docs/html/writing-stories/args
export const Primary: Story = {
args: {
link: 'github.com',
imgSrc: 'https://avatars.githubusercontent.com/u/132667649?v=4',
descricao: 'Octocat from Github '
}
};
9 changes: 9 additions & 0 deletions src/components/card/card.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

.card img {
width: 50px;

}

.card body {
width: 50px;
}
26 changes: 26 additions & 0 deletions src/components/card/card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { avatar } from "../avatar/avatar"
import "./card.css"


/**
* @typedef {object} CardProps
* @property {string} CardProps.nome
* @property {string} CardProps.cargo
* @property {string} CardProps.img
*
* @param {CardProps} props
*/
export function card({nome, cargo, img}) {

return `<div class="card">
<div class="header">
${avatar({imgSrc: img, descricao: 'profile picture from ' + nome})}
</div>

<div class="body">
<p>Nome: ${nome}</p>
<p>Nome: ${cargo}</p>
</div>
</div>`
}

30 changes: 30 additions & 0 deletions src/components/card/card.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import type { StoryObj, Meta } from '@storybook/html';

import { CardProps, card } from './card';

// More on how to set up stories at: https://storybook.js.org/docs/html/writing-stories/introduction#default-export
const meta = {
title: 'App/Card',
tags: ['autodocs'],
render: (args) => {
return card(args);
},
argTypes: {

nome: {description: 'nome do profile'},
cargo: {description: 'cargo do profile'},
img: {description: 'endereço para a imgaem do logo'},
}
} satisfies Meta<CardProps>;

export default meta;
type Story = StoryObj;

// More on writing stories with args: https://storybook.js.org/docs/html/writing-stories/args
export const Primary: Story = {
args: {
nome: 'Paulo Luan',
cargo: 'Student Full Stack Developer',
img: 'https://avatars.githubusercontent.com/u/116959774?v=4',
}
};