Skip to content

Commit

Permalink
Merge pull request #39 from vtex-apps/feature/bookmark
Browse files Browse the repository at this point in the history
Add Bookmark
  • Loading branch information
Breno Calazans authored Dec 27, 2019
2 parents b9ea402 + 23c50f1 commit 40ff080
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 215 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Icon Bookmark.

## [0.14.0] - 2019-11-22
### Added
Expand Down
207 changes: 0 additions & 207 deletions README.md

This file was deleted.

2 changes: 2 additions & 0 deletions ICONPACK.md → docs/ICONPACK.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ We use a series of prefixes to help us understand what an specific icon means.
| ![](docs/mpa-clone--outline.svg) | mpa-clone--outline |
| ![](docs/mpa-clone--filled.svg) | mpa-clone--filled |
| ![](docs/mpa-edit--outline.svg) | mpa-edit--outline |
| ![](docs/mpa-bookmark--filled.svg) | mpa-bookmark--filled |
| ![](docs/mpa-bookmark--outline.svg) | mpa-bookmark--outline |
| ![](docs/mpa-edit--filled.svg) | mpa-edit--filled |
| ![](docs/mpa-external-link--line.svg) | mpa-external-link--line |
| ![](docs/mpa-external-link--outline.svg) | mpa-external-link--outline |
Expand Down
5 changes: 3 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ All Store icons components.

## Concept

This project is based on [SVG fragment identifiers](https://css-tricks.com/svg-fragment-identifiers-work/). All store icons are served by Render SDK, and with HTML tag `<use>` we can render a fragment from our icon pack. If you want to know the complete list of fragment SVG's, [see here](https://github.com/vtex-apps/store-icons/blob/master/ICONPACK.md)
This project is based on [SVG fragment identifiers](https://css-tricks.com/svg-fragment-identifiers-work/). All store icons are served by Render SDK, and with HTML tag `<use>` we can render a fragment from our icon pack. If you want to know the complete list of fragment SVG's, [see here](https://github.com/vtex-apps/store-icons/blob/master/docs/ICONPACK.md)

## Usage

Expand Down Expand Up @@ -145,6 +145,7 @@ Some components support modifiers. These are props that define the icon type, or
| [IconSwap](https://github.com/vtex-apps/store-icons/blob/feature/docs/react/IconSwap.js) | `swap` | 🚫 | 🚫 | 🚫 | 🚫 |
| [IconHeart](https://github.com/vtex-apps/store-icons/blob/feature/docs/react/IconHeart.js) | `heart` | 🚫 | 🚫 | 🚫 | 🚫 |
| [IconGlobe](https://github.com/vtex-apps/store-icons/blob/feature/docs/react/IconGlobe.js) | `globe` | 🚫 | 🚫 | 🚫 | 🚫 |
| [IconBookmark](https://github.com/vtex-apps/store-icons/blob/feature/docs/react/IconBookmark.js) | `bookmark` | filled \| outline | 🚫 | 🚫 | 🚫 |

#### Navigation

Expand All @@ -165,7 +166,7 @@ In the [usage](#usage) section, we discuss two ways of using icons. These ways e

### Overwriting the default IconPack

As mentioned before, all icon IDs are stored at the [iconpack.svg](https://github.com/vtex-apps/store-icons/blob/master/ICONPACK.md) file. You can overwrite the default one by:
As mentioned before, all icon IDs are stored at the [iconpack.svg](https://github.com/vtex-apps/store-icons/blob/master/docs/ICONPACK.md) file. You can overwrite the default one by:

1. On your [`store-theme`](https://github.com/vtex-apps/store-theme/tree/master/styles) create a new folder called `iconpacks`

Expand Down
5 changes: 5 additions & 0 deletions docs/mpa-bookmark--filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/mpa-bookmark--outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/script/scrap-svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $('g').toArray().map(element => {
})

const BASELINE_PATH = path.join(__dirname, 'baseline.md')
const ICONPACK_PATH = path.join(__dirname, '..', '..', 'ICONPACK.md')
const ICONPACK_PATH = path.join(__dirname, '..', 'ICONPACK.md')

fs.copyFile(BASELINE_PATH, ICONPACK_PATH, (err) => {
if (err) throw err
Expand Down
11 changes: 11 additions & 0 deletions react/IconBookmark.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react'

import Icon from './components/Icon'
import { getType } from './utils/helpers'

const IconBoomark = ({ type = 'outline', ...props }: EnhancedIconProps) => {
const typeModifier = getType(type, 'filled, outline')
return <Icon id={`mpa-bookmark${typeModifier}`} {...props} />
}

export default IconBoomark
2 changes: 1 addition & 1 deletion react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"tslint": "^5.11.0",
"tslint-config-vtex": "^2.0.0",
"tslint-eslint-rules": "^5.4.0",
"typescript": "3.5.2"
"typescript": "3.7.3"
},
"resolutions": {
"babel-core": "^7.0.0-bridge.0"
Expand Down
8 changes: 4 additions & 4 deletions react/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4919,10 +4919,10 @@ type-check@~0.3.2:
dependencies:
prelude-ls "~1.1.2"

typescript@3.5.2:
version "3.5.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.2.tgz#a09e1dc69bc9551cadf17dba10ee42cf55e5d56c"
integrity sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA==
typescript@3.7.3:
version "3.7.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.3.tgz#b36840668a16458a7025b9eabfad11b66ab85c69"
integrity sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw==

typescript@^3.3.3333:
version "3.5.3"
Expand Down
3 changes: 3 additions & 0 deletions store/interfaces.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,8 @@
},
"icon-swap": {
"component": "IconSwap"
},
"icon-bookmark": {
"component": "IconBookmark"
}
}
6 changes: 6 additions & 0 deletions styles/iconpacks/iconpack.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 40ff080

Please sign in to comment.