0.5.8 • Published 5 years ago

g-visa-checker v0.5.8

Weekly downloads
120
License
-
Repository
-
Last release
5 years ago

Visa Checker

The visa checker is a front end that is used to display data from the visas endpoint.

How to build and edit locally

First grab a fresh copy of this repository by cloning into it and then installing the npm packages.

Currently, you can only install it as a package. You can reference it using

npm link /path/to/visa-checker

Then you can install it using

// it uses redux, so you'll need to configure the redux store
reducers = combineReducers({
    ...otherReducers,
    visachecker: visaCheckReducer
})
createStore(reducers)

// install it whenever you find a DOM node
const VisaCheckerDOM = document.getElementById('visa-checker')
if(VisaCheckerDOM){
    const countryCodes = VisaCheckerDOM.getAttribute('data-destinations')
    const nationality = getCookie('cnt')
    ReactDOM.render(
        <Provider store={store}>
            <VisaChecker destinations={countryCodes} nationality={nationality}/>
        </Provider>,
        VisaCheckerDOM
    )
}

How to Use

Once you've included the JS file on your page, create a new div tag that with the class visa-checker. Here are the other required and optional attributes.

AttributeDescriptionRequired
classmust be visa-checkerYes
data-destinationstwo digit country code(s)Yes
data-nationalitytwo digit country codeNo

If you do not provide a data-nationality, the Visa checker will be loaded without a nationality, and the user will be required to enter one to get it to display anything.

However, you can enter multiple destinations and the Visa checker will show the results of multiple destinations.

<div
    id="visa-checker"
    data-destinations="US, DE, IN"
    data-nationality="CA"
></div>

The keys are installed via the webpack.DefinePlugin

webpack.DefinePlugin({
    'process.env': JSON.stringify({
        GAPI_PUBLIC_KEY: '',
        GAPI_BASE_URL: '',
    })
})

TODO

  • Tests
  • Make installable as standalone package (with preconfigured redux store).
0.5.8

5 years ago

0.5.7

5 years ago

0.5.6

5 years ago

0.5.5

5 years ago

0.5.4

5 years ago

0.5.3

5 years ago

0.5.2

5 years ago

0.5.0

5 years ago

0.4.4

6 years ago

0.4.3

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.6

6 years ago

0.3.5

6 years ago

0.3.4

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.19

6 years ago

0.2.18

6 years ago

0.2.17

6 years ago

0.2.16

6 years ago

0.2.15

6 years ago

0.2.14

6 years ago

0.2.13

6 years ago

0.2.12

6 years ago

0.2.11

6 years ago

0.2.10

6 years ago

0.2.8

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago