Skip to content

Commit

Permalink
fix: download button icon
Browse files Browse the repository at this point in the history
  • Loading branch information
martintomas committed Oct 29, 2024
1 parent 13ec5e8 commit 1cf0e6f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app/javascript/components/tpi/DownloadFormModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Modal } from './Modal';
import { OverlayProvider } from '@react-aria/overlays';
import Select from './Select';
import classNames from 'classnames';
import downloadIcon from 'images/icons/download.svg';

const Field = ({ label, name, value, onChange, type, required, error, placeholder, children }) => {
const ref = useRef(null);
Expand Down Expand Up @@ -138,7 +139,7 @@ function DownloadFormModal({ downloadUrl }) {
return (
<div className="download">
<button type="button" onClick={() => setShowModal(true)} className="button is-primary with-icon with-border">
<img src="/assets/icons/download.svg" alt="download icon" />
<img src={downloadIcon} alt="download icon" />
CP & MQ Data
</button>

Expand Down
2 changes: 1 addition & 1 deletion app/views/tpi/companies/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<%= react_component('DownloadFormModal', {
downloadUrl: user_download_all_tpi_sectors_path
}) %>
<%= link_to user_download_methodology_tpi_sectors_path, class: 'button is-primary is-pulled-right with-icon with-border' do %>
<%= button_to user_download_methodology_tpi_sectors_path, class: 'button is-primary is-pulled-right with-icon with-border', method: :get do %>
<img src="<%= asset_path 'icons/download.svg'%>" alt="download icon" />
Methodology
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/tpi/sectors/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<%= react_component('DownloadFormModal', {
downloadUrl: user_download_all_tpi_sectors_path
}) %>
<%= link_to user_download_methodology_tpi_sectors_path, class: 'button is-primary is-pulled-right with-icon with-border' do %>
<%= button_to user_download_methodology_tpi_sectors_path, class: 'button is-primary is-pulled-right with-icon with-border', method: :get do %>
<img src="<%= asset_path 'icons/download.svg'%>" alt="download icon" />
Methodology
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/tpi/sectors/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<%= react_component('DownloadFormModal', {
downloadUrl: user_download_tpi_sector_path(@sector)
}) %>
<%= link_to user_download_methodology_tpi_sectors_path, class: 'button is-primary is-pulled-right with-icon with-border' do %>
<%= button_to user_download_methodology_tpi_sectors_path, class: 'button is-primary is-pulled-right with-icon with-border', method: :get do %>
<img src="<%= asset_path 'icons/download.svg'%>" alt="download icon" />
Methodology
<% end %>
Expand Down

0 comments on commit 1cf0e6f

Please sign in to comment.