Skip to content

Commit

Permalink
Merge pull request #315 from ably/feature-link-onclick
Browse files Browse the repository at this point in the history
Add support for onClick to FeaturedLink
  • Loading branch information
kennethkalmer authored Feb 13, 2024
2 parents b9eb157 + 552010d commit aea9c15
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
ably-ui (13.1.0)
ably-ui (13.2.2.dev.78815ed)
view_component (>= 2.33, < 2.50)

GEM
Expand Down
2 changes: 1 addition & 1 deletion lib/ably_ui/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module AblyUi
VERSION = '13.2.2'
VERSION = '13.2.2.dev.78815ed'
end
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ably/ui",
"version": "13.2.2",
"version": "13.2.2-dev.78815ed",
"description": "Home of the Ably design system library ([design.ably.com](https://design.ably.com)). It provides a showcase, development/test environment and a publishing pipeline for different distributables.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion preview/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ gem 'view_component', '~> 2.33.0', require: 'view_component/engine'

gem 'responders'

gem 'ably-ui', '13.2.2', require: 'ably_ui'
gem 'ably-ui', '13.2.2.dev.78815ed', require: 'ably_ui'

# https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias
gem 'psych', '< 4'
Expand Down
4 changes: 2 additions & 2 deletions preview/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GEM
remote: https://rubygems.org/
specs:
ably-ui (13.2.2)
ably-ui (13.2.2.dev.78815ed)
view_component (>= 2.33, < 2.50)
actioncable (6.0.5.1)
actionpack (= 6.0.5.1)
Expand Down Expand Up @@ -176,7 +176,7 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
ably-ui (= 13.2.2)
ably-ui (= 13.2.2.dev.78815ed)
bootsnap (>= 1.4.2)
byebug
dotenv-rails
Expand Down
2 changes: 1 addition & 1 deletion preview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "preview",
"private": true,
"dependencies": {
"@ably/ui": "13.2.2",
"@ably/ui": "13.2.2-dev.78815ed",
"@babel/preset-react": "^7.12.5",
"@rails/ujs": "^6.0.0",
"@rails/webpacker": "5.4.4",
Expand Down
8 changes: 4 additions & 4 deletions preview/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# yarn lockfile v1


"@ably/[email protected]":
version "13.2.2"
resolved "https://registry.yarnpkg.com/@ably/ui/-/ui-13.2.2.tgz#c6296b4f2fbcfe0c7cc6e9bbdb73fdd37a32def6"
integrity sha512-nIozCQJVwuwInKxHWll1GN1pMiVjcfVaqh5BrWOdmq0Xj1GieW5wWM+Zb83h2LleotvbtlMlfwJh2evCy7ms5A==
"@ably/[email protected]-dev.78815ed":
version "13.2.2-dev.78815ed"
resolved "https://registry.yarnpkg.com/@ably/ui/-/ui-13.2.2-dev.78815ed.tgz#3b0329452a7d294aab064ee2a196ce6cec7fad43"
integrity sha512-JLX8CWo06ZuxfA1m1au0KsNjZ7IMCRtvTMQyljshZqVGJpVjo09Mzj22PheUpcsWlhYZkMYYuHupDr/8qI+NjQ==
dependencies:
"@mrtkrcm/cypress-plugin-snapshots" "https://github.com/mrtkrcm/cypress-plugin-snapshots#v1.13.0"
addsearch-js-client "^0.7.0"
Expand Down
3 changes: 3 additions & 0 deletions src/core/FeaturedLink/component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const FeaturedLink = ({
reverse = false,
additionalCSS = "",
newWindow = false,
onClick = undefined,
children,
}) => {
const targetAndRel = buildTargetAndRel(url, newWindow);
Expand All @@ -42,6 +43,7 @@ const FeaturedLink = ({
} ${additionalCSS}`}
style={{ "--featured-link-icon-size": `var(${textSize.replace("text", "--fs")})` }}
{...targetAndRel}
onClick={onClick}
>
{reverse ? (
<>
Expand Down Expand Up @@ -77,6 +79,7 @@ FeaturedLink.propTypes = {
reverse: T.bool,
additionalCSS: T.string,
newWindow: T.bool,
onClick: T.func,
};

export default FeaturedLink;

0 comments on commit aea9c15

Please sign in to comment.